Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8013232

External access cannot be allowed through parser(s) properties for XInclude

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • None
    • xml
    • None

      It is impossible to allow external access to external DTDs either by setting property in the case of SAX Parser (1) or by setting specific attribute in the case of the DocumentBuilder if If XInclude markup is allowed (3) and found in the document instance. Although System Property (4) works perfectly in both cases.
      1) parser.setProperty(ACCESS_EXTERNAL_DTD, "file");
      2) factory.setAttribute(ACCESS_EXTERNAL_DTD, "file");
      3) factory.setXIncludeAware(true);
      4) System.setProperty(SP_ACCESS_EXTERNAL_DTD, "file");

      I think that it should be allowed to use parser properites/attributtes to set up external access in the case of XInclude.
      What do you think?

      Enclosed you will find code and data files to reproduce this issue:

      > java -Djava.endorsed.dirs=/files/devel/jaxp1.5/endorsed org.kleo.ExternalAccessTest
      (SAX) JAXP Property - fail: Error attempting to parse XML file (href='simple.xml').
      (SAX) SystemProperty- ok: javax.xml.accessExternalDTD (file)
      [Fatal Error] test2.xml:3:32: External DTD: Failed to read external DTD '', because 'file' access is not allowed.
      [Fatal Error] simple.xml:12:41: Error attempting to parse XML file (href='test2.xml').
      [Fatal Error] roottest.xml:4:22: Error attempting to parse XML file (href='simple.xml').
      (DOM) JAXP Property - fail: Error attempting to parse XML file (href='simple.xml').
      (DOM) SystemProperty- ok: javax.xml.accessExternalDTD (file)

            joehw Joe Wang
            lkuskov Leonid Kuskov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: