Has anyone thought about using XNI Augmentations to support round-tripping?

For example I'd like to be able to parse an XML file, modify a single
attribute value, and then output an XML file that was otherwise identical to
the one I read in. Currently Xerces doesn't support this - e.g. it can't
tell the difference between:

<a b="c"/>

and:

<a    b   =   'c'   />

I'd like to use XNI Augmentations to (optionally) pass the missing info to
the application. As a test, I modified Xerces 2.0.2 to handle this example
case. It records the whitespace after each element name and each attribute,
the whitespace before and after the equals sign of each attribute, and the
type of quote used for each attribute value. Then I modified the xni.Writer
example to use this info when outputting the XML, and it seems to work fine.
It seems like it would be straightforward to keep going with this, using
Augmentations to add back all of the info that gets lost, so that you can
output exactly the same document as you read in.

This seems pretty useful. Does this seem like a good idea? Has anyone else
done this kind of thing already? If this were implemented as an optional
parser feature, would there be any interest in adding this as a standard
Xerces feature? (Assuming that there was a negligible performance impact
when it was turned off.) Doing a quick search through the archives I noticed
a few requests for this capability, e.g.:

http://marc.theaimsgroup.com/?l=xerces-j-dev&m=97844641232377&w=2

Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to