Way back when I opened an issue about using XML entity includes in Solr as a way to break up the config. I have found problems with XInclude having multiple elements to include because the file is not well formed. From what I have read, if you make this well formed, you end up with a document that's not what you expect.
For example: my schema.xml has <fields> ... <xinclude href="more_fields.xml .../> </fields> more_fields.xml <field name="..."... which isn't well formed. You could make it well formed: <fields> <field name ="..."... </fields> but then I think you end up with nested <fields> element which doesn't work (and btw I still keep getting the blasted failed to parse error which isn't very helpful). Looking at this made me wonder if entity includes work with Solr 4 and indeed they do! They aren't as flexible as XIncludes but for the purpose of breaking up an XML file into smaller pieces, it works beautifully and as you would expect. You can simply declare your entities at the top as shown in the earlier thread and then include them where you need. I've been using this for years and it works fairly well. Cheers! Amit On Thu, May 31, 2012 at 7:01 AM, Bogdan Nicolau <bogdan....@gmail.com> wrote: > I've also tried a lot of tricks to get xpointer working with multiple child > elements, to no success. > In the end, I've resorted to a less pretty, other-way-around solution. I do > something like this: > solrconfig_common.xml -> no xml declaration, no root tag, no nothing > <etc></etc> > <etc2></etc2> > ... > For each file that I need the common stuff into, I'd do something like this: > solrconfig_master.xml/solrconfig_slave.xml/etc. > <?xml version="1.0" encoding="UTF-8" ?> > <!DOCTYPE config [ > <!ENTITY solrconfigcommon SYSTEM > "solrconfig_common.xml"> > ]> > > <config> > &solrconfigcommon; > > </config> > > Solr starts with 0 warnings, the configuration is properly loaded, etc. > Property substitution also works, including inside the > solrconfig_common.xml. Hope it helps anyone. > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/XInclude-Multiple-Elements-tp3167658p3987029.html > Sent from the Solr - User mailing list archive at Nabble.com.