[ 
https://issues.apache.org/jira/browse/SOLR-6042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13989715#comment-13989715
 ] 

Uwe Schindler edited comment on SOLR-6042 at 5/5/14 5:14 PM:
-------------------------------------------------------------

FYI: In addition to xinclude you can use named entities to include other stuff. 
the good thing with named entities is: they don't need a root element. The 
trick is to use the following code in your config file (xinclude is then not 
needed!):

{code:xml}
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE solrschema [
  <!ENTITY types SYSTEM "mytypes.xml">
]>
<schema name="example" version="1.5">
  <elementA/>
  <elementB/>
  &types;
  <somethingElse/>
</schema>
{code}

The only backside: You have to declare the DTD on top of the file where you 
list all external references, give them "entity names". In the XML source code 
you can insert those entities with {{&entity;}}.

See also: [https://github.com/mapnik/mapnik/wiki/ManagingLargeXmlFiles]


was (Author: thetaphi):
FYI: In addition to xinclude you can use named entities to include other stuff. 
the good thing with named entities is: they don't need a root element. The 
trick is to use the following code in your config file (xinclude is then not 
needed!):

{code:xml}
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE solrschema [
  <!ENTITY types SYSTEM "mytypes.xml">
]>
<schema name="example" version="1.5">
  <elementA/>
  <elementB/>
  &types;
  <somethingElse/>
</schema>
{code}

The only backside: You have to declare the DTD on top of the file where you 
list all external references, give them "entity names". In the XML source code 
you can insert those entities with {{&entity;}}.

> Allow XInclude'ed config to have a top level <INCLUDE> which gets stripped
> --------------------------------------------------------------------------
>
>                 Key: SOLR-6042
>                 URL: https://issues.apache.org/jira/browse/SOLR-6042
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: David Smiley
>            Priority: Minor
>
> The XInclude feature is pretty cool but it's limited to including a 
> configuration element that has one top level tag.  For example "<types>".  
> That's a big limitation.  This issue proposes that a special XML element of 
> the name "INCLUDE" (or whatever) be allowed in a config file, which is 
> stripped out when Solr reads the file.  Solr would recursively check for 
> elements of this name and if found then replace the node with all its 
> children.  In practice, nobody would use this except as a root of an 
> XInclude'ed configuration fragment.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to