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

Support the mode that doesn't load external DTD (sjsxp issue 50)

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.4
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        GlassFish v3 is using StAX to load its configuration files written in XML.

        The problem we have is that for compatibility reasons we have to read XML that
        has DOCTYPE declaration, but we'd like to simply ignore that for performance
        reason, as if DOCTYPE decl didn't even exist.

        Woodstox does this by using the XMLInputFactory.SUPPORT_DTD feature (See
        http://jira.codehaus.org/browse/WSTX-117), although the javadoc in API is not
        clear whether that was the intended behavior (as usual!)

        According to the bug report, BEA RI doesn't behave like Woodstox, and looking at
        the code I know SJSXP doesn't behave that way either. Quoting
        XMLDocumentScannerImpl line 326,

                fDisallowDoctype =
        !((Boolean)propertyManager.getProperty(XMLInputFactory.SUPPORT_DTD)).booleanValue();
                fBindNamespaces =
        ((Boolean)propertyManager.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)).booleanValue();
                // xerces features
                fLoadExternalDTD = true ;


        As I wrote earlier, our end goal is to have a support in SJSXP to ignore
        external DTD, which presumably can be easily done by having SJSXP define a
        property which sets "fLoadExternalDTD" off.

        The only downside in doing that is that GFv3 won't be able to work with
        Woodstox, so the other option I'd like SJSXP team to consider is to use
        SUPPORT_DTD feature in the same way Woodstox uses. I agree with Tatu's analysis
        in WSTX-117 that Woodstox behavior is more likely what the user expects (even if
        it's XML REC violation), but I'm sure there are compatibility implications and
        so on that you'd have to consider.

        In any case, if you can resolve this issue by giving us some way to set
        fLoadExternalDTD, that would be what we care the most. If you can do it in such
        a way that our users can switch between Woodstox and SJSXP easily, that's
        better, but it's a lesser issue.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                joehw Joe Wang
                Reporter:
                joehw Joe Wang
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: