#678 Xerces XInclude problems

v8.9
closed
5
2012-10-08
2007-03-19
Michael Kay
No

When the -xi option is used on the command line (or the equivalent in the Java API) to invoke XInclude processing, and the selected XML parser is the version of Xerces included by default in JDK 1.5 (specifically JDK 1.5.0_09), then it appears that namespace declarations in the document fetched using xi:include are not processed correctly, resulting in spurious XML parsing errors.

These problems go away if Xerces 2.9.0 is used in place of the parser shipped with the JDK. You can use this parser by downloading it say into c:\Xerces and using the Java system property

-Djava.endorsed.dirs=c:\Xerces\xerces-2_9_0

However, this raises another problem which is that the SAX feature switch used to activate XInclude processing in Xerces 2.9.0 is apparently different from that used in the JDK: the JDK uses (and Saxon attempts to set) "http://apache.org/xml/features/xinclude-aware", while Xerces 2.9.0 requires "http://apache.org/xml/features/xinclude".

A patch is being placed in Subversion which attempts to set the second feature name if the first one fails.

Discussion

  • Michael Kay

    Michael Kay - 2007-03-19

    Logged In: YES
    user_id=251681
    Originator: YES

    The patch is to module net.sf.saxon.event.Sender at line 247, and is in Subversion at revision 108.

     
  • Michael Kay

    Michael Kay - 2007-06-27

    Logged In: YES
    user_id=251681
    Originator: YES

    Fixed in 8.9.0.4