[xsd-users] XML 1.1 and restricted characters

Boris Kolpackov boris at codesynthesis.com
Thu Apr 22 15:23:02 EDT 2010


Hi Eric,

Eric Niebler <eric at boostpro.com> writes:

> What I need is (A) a way to configure XSD serialization so that it emits
> the XML declaration as:
> 
>  <?xml version="1.1" ...?>
> 
> and (B) to translate restricted characters into their escaped
> equivalents. Is there an easy way to do this?

I believe setting the DOM document version should do the trick.
In Xerces-C++ 2-series it will be:

doc->setVersion (XMLUni::fgVersion1_1);

In Xerces-C++ 3-series it will be:

doc->setXmlVersion (XMLUni::fgVersion1_1);

I think even setting it after populating the DOM document and just
before writing it out will work. If not, then you can create an
empty DOM document, set its version to 1.1, serialize the object
model to this DOM document, and then write it out.

Let us know how it goes.

Boris



More information about the xsd-users mailing list