Patch #1406
closedfix for SAX / Xerces 2.5.0 xinclude
0%
Description
SourceForge user: npitman
Saxon 7.6.5 does not correctly process XInclude files as
document source in Xerces 2.5.0, when Xerces uses
EntityResolvers to load the XIncluded sources. (Xerces
2.5.0 has a minor problem, but they know and the fix is
in the pipeline)
The problem revolves around propagating the
EntityResolvers to the the XMLReader created in
Configuration.getSourceParser(). This is three levels
down from the Controller.Transform which kicks off the
transform. The XMLReader is constructed directly from
factories, but without any EntityResolver. Xerces needs
this when it hits an xi:include and needs a resolver.
There are three issues - specifying the EntityResolver to
the transform; remembering it; and configuring the
XMLReader.
This patch does the second and third. To specify the
EntityResolver, a Saxon user must insert the following
before the Transformer.transform(Source, Result);
((Controller)transformer).getConfiguration
().setEntityResolver(xIncludeResolver);
(This is quite ugly, but a simple setter in Controller can
wrap it. )
The supplied patch adds an instance
variable 'entityResolver' and its accessors to
Configuration; and assigns this resolver to the
XMLReader in getSourceParser().
It is likely that this patch is incomplete. I did not
consider style parsers or a DOM environment.
Files
Updated by Michael Kay over 11 years ago
- Status changed from New to Closed
Overtaken by events. There is no reason to believe this bug is still present in recent Saxon or Xerces releases.
Please register to edit this issue