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

Marshall Schor commented on UIMA-239:
-------------------------------------

After some more investigation, there's quite a difference between the 
JAXB-generated classes and our current "models"; it would be a very big piece 
of work to switch, I think.

So, I'm now thinking of this alternative:
1) modify the existing parser to optionally (additionally) save the DOM (that 
is already being produced, with the ignorable-whitespace and comments nodes.
2) add a method for serializing to XML that takes this saved DOM, and then does 
a fairly naive adding back of the comment and whitespace nodes while 
serializing, from the saved DOM, where it can find a "match".  This ought to 
save most of the comments, except of course, if whole nodes have been deleted 
or added.  A general solution might be quite complex, but I suspect we can 
cover the major use cases quite simply, since the xml at each level is 
"ordered" (mostly).

This would have a very minimal impact on the existing code :-). And the 
additional information (including comment nodes themselves) would only be 
collected if requested.  (I suspect only the CDE will use this for now). 
                
> Tools like the CDE which use XML parsing should preserve XML comments; 
> parsers should provide access to XML comments.
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-239
>                 URL: https://issues.apache.org/jira/browse/UIMA-239
>             Project: UIMA
>          Issue Type: Improvement
>          Components: Core Java Framework, Tools
>            Reporter: Marshall Schor
>
> An example of a problem which happens if this is not done: the descriptors 
> that come with the UIMA toolkit have a comment that specifies the license 
> information for that file. If you edit a descriptor containing such a comment 
> with the CDE, it strips out all comments.
> An alternative for license info: add a new, optional element to the 
> descriptor for specifying the license (but this might  be ambigious as to 
> what is being licensed - the descriptor file or what it refers to or ??? )

--
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

        

Reply via email to