[xsde-users] Re: How to serialize with an xml declaration. ?

Boris Kolpackov boris at codesynthesis.com
Fri Jul 9 13:49:41 EDT 2010


Hi Hari,

In the future please send emails like this to xsde-users at codesynthesis.com
instead of xsde-users-owner at ...

Hari Narni <hari.narni at in.abb.com> writes:

> Hello Boris ,
> 
> I' m using the Xsd/e  ( embedded codesynthesis) .
> Can you please suggest on , how to create an xml content using 
> serialization with the xml declarations like ( <?xml version="1.0" ?> ) in 
> hybrid mapping.
> Because i couldn't find any info from the documentation especially in the 
> above scenario .

The serializer does not add an XML declaration (it is optional) but
you can write it yourself to the stream just before calling the
serializer. Using the 'library' example, the relevant code would
look like this:

catalog_s.pre (*c);
cout << "<?xml version=\"1.0\" ?>" << endl;
doc_s.serialize (cout, xml_schema::document_simpl::pretty_print);
catalog_s.post ();

Boris



More information about the xsde-users mailing list