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

Uwe Schindler commented on SOLR-3604:
-------------------------------------

With XML as config file format, there is not much you can do, as the parser 
strips all comments (most do) and only some of them are able to preserve them 
in resulting DOM tree.
As the DOM tree is later thrown away and the config is only persisted as Java 
Objects, the comments get finally lost at that stage (if not already by parser).
SolrXmlSerializer is not XML conform at all (it's a hack, correct would be to 
use SAX or DOM serialization), so it could be modified to add comments, but 
without data where they were originally, you have no chance.

The only chance to preserve comments would be a complete rewrite, don't throw 
away the DOM tree and let core manipulation work directly on the DOM tree (this 
can e.g. be done by a custom mapping class build from an XSD file). At the end 
serialize DOM tree again to file. This of course needs a parser that preserves 
all comments during parsing and serialization. Almost impossible :(
                
> The wiki claims all comments are wiped from solr.xml on save - we should fix 
> this.
> ----------------------------------------------------------------------------------
>
>                 Key: SOLR-3604
>                 URL: https://issues.apache.org/jira/browse/SOLR-3604
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Mark Miller
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 4.0, 5.0
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to