[xsd-users] annotations

Boris Kolpackov boris at codesynthesis.com
Thu Aug 23 03:18:11 EDT 2007


Hi Uri,

Uri Karagila <uri at hyperroll.com> writes:

> While mapping xml trees 2 issues emerged:
> 1. can I manipulate (e.g., create new) annotations while
> creating\mapping my xml tree?

You can serialize the object model to a DOM document, create
comments and then serialize the DOM document to XML. Alternatively
you can customize your types (or xml_schema::type) to add comments.

> 2. in case xml file (which includes annotations) was "loaded" into
> memory, I assume comments are not going to lost while tree is being
> "flushed" back into an xml file. Correct?

No, comments will be discarded. This questions was already raised by
Inna Grois, see the "Keeping annotations/comments in xml file" thread
for more information on how you can preserve comments:

http://www.codesynthesis.com/pipermail/xsd-users/2007-August/thread.html

hth,
-boris




More information about the xsd-users mailing list