[xsd-users] XML 1.1 and restricted characters

Eric Niebler eric at boostpro.com
Thu Apr 22 16:45:13 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 4/22/2010 12:23 PM, Boris Kolpackov wrote:
> 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.

WOW! That was easy. Works like a charm. I can set the version even after
populating the DOM.

Feature request: pls. expose this xerces functionality as a flag that I
can pass to the serialization functions that XSD generates.

Thanks, Boris!

- -- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJL0LVZAAoJEAeJsEDfjLbXeAUH/2wpV4yrqbBxUb275+J1k9h+
wzS1Gu5iurzJEAxsU35K2TJ9twQ2jdKD9MW5pjjba/mJEtqc88WcOK8MsJuOCH6w
1OhtIEx2fIQqSMylcR5XTfADoxlXFA5VwTPS/gnneBxN2KUDqKvLetSuEv2OM/RK
QYZp+S4Xu4aeDFM9JxURXJ3Z/ZIkX+Tn++C3QIkOAS0lSCrqH+mSkgg6jUwIpflt
srUbENWhuJmq2KoN9Of4B8plltdlhZXczLEaOffh/CGBC7u46o1adnrWWrhzAPZp
6l72T7/56CvmgZ9bHkd7XRonKod4ZBqWsyuAVbotwWL7DhjacALJaD0CDes8I58=
=NO2/
-----END PGP SIGNATURE-----



More information about the xsd-users mailing list