Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#3 fix for SAX / Xerces 2.5.0 xinclude

open
nobody
None
5
2012-10-08
2003-08-28
Neil Pitman
No

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.

Discussion


Anonymous


Cancel   Add attachments