: I'm having a problem with this idea.  It seems that what you include with
: XInclude can only be a single XML element, not "big chunks" as I had hoped.
: If you have more than one, it dies.  It took running it through xmllint to
: figure out why, the Solr exception was not informative.  This will make it
: choke if included in a single file:

First off: all of the files need to be wellformed XML, or the XML parser 
will complain before Solr ever even gets a chance at a good error message.

Second: in order to include the sub-elements of the root tag from your 
included file, w/o including the root element itself (ie: so you can have 
a bunch of request handlers declared in an XML file with an arbitrary root 
tag to make the file well formed) i think you need to use the xpointer 
option when doing the XInclude.  Here's an example in the XInclude 
docs...

  http://www.w3.org/TR/xinclude/#fragment-example

...i suspect you want something like...

  <xi:include href="handlers.xml" xpointer="//requestHandler" />

where handlers.xml looks like...

<anyThingYouWant>
<requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
<requestHandler name="/update/javabin" class="solr.BinaryUpdateRequestHandler" 
/>
<requestHandler name="/analysis/document" 
class="solr.DocumentAnalysisRequestHandler" />
<requestHandler name="/analysis/field" class="solr.FieldAnalysisRequestHandler" 
/>
<requestHandler name="/update/csv" class="solr.CSVRequestHandler" 
startup="lazy" />
<requestHandler name="/admin/" 
class="org.apache.solr.handler.admin.AdminHandlers" />
</anyThingYouWant>



-Hoss

Reply via email to