[xsd-users] get string of subtree

Adrian Stern adrian.stern at screenfood.com
Tue May 21 08:38:57 EDT 2013


Hi Boris

Thanks for your Answer. Good to hear that it is actually a simple task. Could you point me to this example? I'm not able to google it. Do you mean chapter 5 (parsing) in the Guide? http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/

And also are there any "best practices" about how to configure xsdcxx? I've some methods called "methodname_" which is quite ugly and unmeaningly.

Thanks for all your help. This is a great product.

Freundliche Grüsse / Best Regards / Meilleures salutations
Adrian Stern

-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com]
Sent: 15 May 2013 21:31
To: Adrian Stern
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] get string of subtree

Hi Adrian,

Adrian Stern <adrian.stern at screenfood.com> writes:

>  - Can I get the xml-string from a sub tree? (the important question
> is how)

Every XSD-generated class can be serialized into a DOMElement. So the idea is to create a DOMDocument, serialize your sub-tree into it, and finally serialize DOMDocument to string (using std::ostringstream).

An example that is the closest to what you are trying to do is 'messaging'.
In particular, it shows how to create a DOMDocument instance and how to save it to std::ostream (the function that does that is in the dom-serialize.?xx files). The only bit that will be different in your case is the serialization of the sub-tree. It will look like
this:

const foo& f = ...; // Your sub-tree.
*doc->getDocumentElement () << x;


>  - Why does my IDE (qtcreator seem to be unable to show me any
> completion info on playlist_sequence (or other _sequences for that matter).

Probably because it cannot parse/understand the templates that are used to implement sequences. Maybe upgrading to a more recent version will help.

Boris
Diese E-Mail und ihre Anhänge enthalten vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail inklusive Anhänge. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der Inhalte dieser Mail ist nicht gestattet.
This e-mail and any attachments may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail including the attachments. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



More information about the xsd-users mailing list