[xsd-users] "flushing" xml object tree into xml file - please
boris at codesynthesis.com
Wed May 9 09:05:52 EDT 2007
Thanks for remembering to post your question to xsd-users.
Uri Karagila <uri at hyperroll.com> writes:
> In case my xml tree is fully loaded, how can I "flush" it into file.xml?
> Can you please point to relevant documentation or provide useful
First of all you will need to compile your schemas with the
--generate-serialization option in order to generate the serialization
code. The library example (in examples/cxx/tree) shows how to write the
tree to stdout (std::cout object). In order to write it to a file, you
can replace this line:
catalog_ (std::cout, *c, map);
with something like this:
std::ofstream ofs ("file.xml");
catalog_ (ofs, *c, map);
(You will also need to add #include <fstream> at the beginning).
For more information on serializing the in-memory representation to XML,
refer to Chapter 4, "Serialization", of the C++/Tree Mapping User Manual:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070509/972790d2/attachment.pgp
More information about the xsd-users