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

Uwe Schindler commented on SOLR-2436:
-------------------------------------

Here is the new way to load XML from ResourceLoaders in Solr (taken from 
Config). This code also intercepts errors and warnings and logs them correctly 
(parsers tend to write them to System.err):

{code:java}
is = new InputSource(loader.openConfig(name));
is.setSystemId(SystemIdResolver.createSystemIdFromResourceName(name));


// only enable xinclude, if a SystemId is available
if (is.getSystemId() != null) {
        try {
                dbf.setXIncludeAware(true);
                dbf.setNamespaceAware(true);
        } catch(UnsupportedOperationException e) {
                log.warn(name + " XML parser doesn't support XInclude option");
        }
}

final DocumentBuilder db = dbf.newDocumentBuilder();
db.setEntityResolver(new SystemIdResolver(loader));
db.setErrorHandler(xmllog);
try {
        doc = db.parse(is);
} finally {
        // some XML parsers are broken and don't close the byte stream (but 
they should according to spec)
        IOUtils.closeQuietly(is.getByteStream());
}
{code}

> move uimaConfig to under the uima's update processor in solrconfig.xml
> ----------------------------------------------------------------------
>
>                 Key: SOLR-2436
>                 URL: https://issues.apache.org/jira/browse/SOLR-2436
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 3.1
>            Reporter: Koji Sekiguchi
>            Priority: Minor
>         Attachments: SOLR-2436-3.patch, SOLR-2436.patch, SOLR-2436.patch, 
> SOLR-2436.patch, SOLR-2436_2.patch
>
>
> Solr contrib UIMA has its config just beneath <config>. I think it should 
> move to uima's update processor tag.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to