The various XInclude specs were never really fully implemented by XML
parsers. IMO it's really best for including whole XML files. If I
remember right, the situation is that the xpointer() scheme (the most
flexible) wasn't implemented. There are two other schemes for
addressing content within a document. One of them (the sort of
"default" scheme - see
http://www.w3.org/TR/2003/REC-xptr-framework-20030325/) relies on
identifiers in the document, but to get these identifiers "identified",
you have to run the document through a DTD or Schema validation step as
part of parsing. I never did get that to work, but if you're diligent
it seems possible. The other scheme (the element() scheme) allows you
to address child nodes by simple paths - like XPath, but much more
limited syntax (see http://www.w3.org/TR/2003/REC-xptr-element-20030325/)
-Mike
I did attempt the xpointer="xpointer(//requestHandler)" syntax, and
received this error: 2011-07-13 18:49:06,640 [main] WARN
org.apache.solr.core.Config - XML parse warning in
"solrres:/solrconfig.xml", line 3, column 133: SchemeUnsupported: The
XPointer scheme 'xpointer' is not supported. This matches what the
wiki page indicates, and the Xerces FAQ confirms, which is that Xerces
does not support the xpointer() scheme. I was not able to find any
indication that there was any Java libraries available that do support
the xpointer scheme. If anyone knows of one, and how to configure
Solr to use it, that would almost certainly fix my problem.
I do understand that Solr isn't doing anything special with XInclude.
But from my attempts to understand the state of XInclude on the JVM, I
am unable to identify a useful technique for taking advantage of it to
share configuration in Solr. My hope was that someone who had used it
successfully could indicate either something I missed about how to
make it work, or a useful pattern for working within the limitations
of the available functionality.
Stephen Duncan Jr
www.stephenduncanjr.com