-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
1.4
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2185510 | 7 | Joe Wang | P3 | Closed | Fixed | m05 |
JDK-2182525 | 6u18 | Joe Wang | P2 | Resolved | Fixed | b02 |
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.
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.
- backported by
-
JDK-2182525 Support the mode that doesn't load external DTD (sjsxp issue 50)
- Resolved
-
JDK-2185510 Support the mode that doesn't load external DTD (sjsxp issue 50)
- Closed