XalanJ2
  1. XalanJ2
  2. XALANJ-2544

Entities resolving with resolver is not available for XSLT file

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.x
    • Fix Version/s: None
    • Component/s: Xalan
    • Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects. Anybody can view the issue.)
    • Labels:
      None
    • Xalan info:
      PatchAvailable

      Description

      In case an XSLT file contains reference to any entities, and an entity resolver is used, the resolver is given a chance to look up in the catalog only after the original reference in the internet is consulted and fetched. A case may look like this:

      <?xml version="1.0" standalone="yes" ?>
      <!DOCTYPE transform [
      <!ENTITY % w3centities-f PUBLIC "-//W3C//ENTITIES Combined Set//EN//XML"
      "http://www.w3.org/2003/entities/2007/w3centities-f.ent">
      %w3centities-f;
      ]>
      <xsl:transform version="1.0"
      ...

      For that case if no internet connection is available, a java.net.UnknownHostException is thrown by Xalan-J command line utility referencing "www.w3.org".

        Activity

        Hide
        Sergey Ushakov added a comment -

        A patched binary build is available form my blog page "XSLT, entities, Java, Xalan..." at http://s-n-ushakov.blogspot.com/2011/09/xslt-entities-java-xalan.html .

        Show
        Sergey Ushakov added a comment - A patched binary build is available form my blog page "XSLT, entities, Java, Xalan..." at http://s-n-ushakov.blogspot.com/2011/09/xslt-entities-java-xalan.html .
        Sergey Ushakov made changes -
        Hide
        Sergey Ushakov added a comment -

        A new set of patches (in "diff -u" format) the resolve the issue, probably partially. In particular, XSLTC is likely to need extra attention.

        An entity resolver, if available, is supplied to the transformer factory as an attribute, to be further provided for the reader instances.

        An extra property is defined for this new sort of attribute.

        Show
        Sergey Ushakov added a comment - A new set of patches (in "diff -u" format) the resolve the issue, probably partially. In particular, XSLTC is likely to need extra attention. An entity resolver, if available, is supplied to the transformer factory as an attribute, to be further provided for the reader instances. An extra property is defined for this new sort of attribute.
        Sergey Ushakov made changes -
        Attachment org.apache.xalan.xslt.Process.diff [ 12496637 ]
        Sergey Ushakov made changes -
        Attachment org.apache.xalan.transformer.XalanProperties.diff [ 12496636 ]
        Sergey Ushakov made changes -
        Attachment org.apache.xalan.processor.TransformerFactoryImpl.diff [ 12496635 ]
        Sergey Ushakov made changes -
        Description In case an XSLT file contains reference to any entities, and an entity resolver is used, the resolver is given a chance to look up in the catalog only _after_ the original reference in the internet is consulted and fetched. A case may look like this:

        <?xml version="1.0" standalone="yes" ?>
        <!DOCTYPE transform [
            <!ENTITY % w3centities-f PUBLIC "-//W3C//ENTITIES Combined Set//EN//XML"
                "http://www.w3.org/2003/entities/2007/w3centities-f.ent">
            %w3centities-f;
        ]>
        <xsl:transform version="1.0"
        ...

        For that case if no internet connection is available, a java.net.UnknownHostException is throw referencing "www.w3.org".
        In case an XSLT file contains reference to any entities, and an entity resolver is used, the resolver is given a chance to look up in the catalog only _after_ the original reference in the internet is consulted and fetched. A case may look like this:

        <?xml version="1.0" standalone="yes" ?>
        <!DOCTYPE transform [
            <!ENTITY % w3centities-f PUBLIC "-//W3C//ENTITIES Combined Set//EN//XML"
                "http://www.w3.org/2003/entities/2007/w3centities-f.ent">
            %w3centities-f;
        ]>
        <xsl:transform version="1.0"
        ...

        For that case if no internet connection is available, a java.net.UnknownHostException is thrown by Xalan-J command line utility referencing "www.w3.org".
        Sergey Ushakov made changes -
        Attachment org.apache.xalan.processor.TransformerFactoryImpl.diff [ 12496635 ]
        Attachment org.apache.xalan.transformer.XalanProperties.diff [ 12496636 ]
        Attachment org.apache.xalan.xslt.Process.diff [ 12496637 ]
        Hide
        Sergey Ushakov added a comment -

        A patch the resolves the issue, probably partially. In particular, XSLTC is likely to need extra attention.

        An entity resolver, if available, is supplied to the transformer factory as an attribute, to be further provided for the reader instances.

        An extra property is defined for this new sort of attribute.

        Show
        Sergey Ushakov added a comment - A patch the resolves the issue, probably partially. In particular, XSLTC is likely to need extra attention. An entity resolver, if available, is supplied to the transformer factory as an attribute, to be further provided for the reader instances. An extra property is defined for this new sort of attribute.
        Sergey Ushakov made changes -
        Field Original Value New Value
        Description In case an XSLT file contains reference to any entities, and an entity resolver is used, the resolver is given a chance to look up in the catalog only _after_ the original reference in the internet is consulted and fetched. A case may look like this:

        <?xml version="1.0" standalone="yes" ?>
        <!DOCTYPE transform [
            <!ENTITY % w3centities-f PUBLIC "-//W3C//ENTITIES Combined Set//EN//XML"
                "http://www.w3.org/2003/entities/2007/w3centities-f.ent">
            %w3centities-f;
        ]>
        <xsl:transform version="1.0"
        ...

        For that case if no internet connection is available, a java.net.UnknownHostException is throw referencing 'www.w3.org&#39;.
        In case an XSLT file contains reference to any entities, and an entity resolver is used, the resolver is given a chance to look up in the catalog only _after_ the original reference in the internet is consulted and fetched. A case may look like this:

        <?xml version="1.0" standalone="yes" ?>
        <!DOCTYPE transform [
            <!ENTITY % w3centities-f PUBLIC "-//W3C//ENTITIES Combined Set//EN//XML"
                "http://www.w3.org/2003/entities/2007/w3centities-f.ent">
            %w3centities-f;
        ]>
        <xsl:transform version="1.0"
        ...

        For that case if no internet connection is available, a java.net.UnknownHostException is throw referencing "www.w3.org".
        Sergey Ushakov created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Sergey Ushakov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development