On 2/14/07, Marshall Schor <[EMAIL PROTECTED]> wrote:
Thilo Goetz (JIRA) wrote:
> [
https://issues.apache.org/jira/browse/UIMA-239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12472242
]
>
> Thilo Goetz commented on UIMA-239:
> ----------------------------------
>
> This should really be fixed properly if at all possible. It's super annoying
when tooling removes your carefully placed XML comments. One would imagine that
the Eclipse classes we use for reading and writing the XML support this.
>
Would using the SAX LexicalHandler make this work? I guess we'd need a
way to store the comments in the data model
the parser constructs from the XML, and write it back out. Adam - I
think you looked into this once - is this the right approach,
or is there something better to consider?
Descriptors are parsed using DOM, not SAX. (If someone wants to
volunteer to convert it to SAX, I have no objection, but that's
another story. :) A brief look at the DOM javadocs shows there is a
Comment interface (a type of Node in a DOM tree). Assuming the parser
actually populates that, we should have access to the comments in that
way.
Then as you suggest there needs to be a property on all of our
MetaDataObjects (the supertype of all objects that make up our
descriptors) that holds the comments, and the MetaDataObject.toXML()
method must be updated to write these out.
-Adam