[xsd-users] xsd to xml parser

ss ak ssak22 at gmail.com
Wed Aug 26 17:13:28 EDT 2009


 I donot have any method like in the example generated...


// Serialize to a string.

std::ostringstream oss;

mp(oss, p, map);

std::string xml (oss.str ());


example has:

xml_schema::namespace_infomap map;

map["lib"].name = "http://www.codesynthesis.com/library";

map["lib"].schema = "library.xsd";

 // Write it out.

catalog_ (std::cout, *c, map); --->this type of method is not generated..how
do i get this...

}

catch (const xml_schema::exception& e)

{

cerr << e << endl;

return 1;

}

On Wed, Aug 26, 2009 at 1:43 PM, Boris Kolpackov <boris at codesynthesis.com>wrote:

> Hi,
>
> ss ak <ssak22 at gmail.com> writes:
>
> > I have generated the C++ binding using the below...
> >
> > xsd.exe cxx-tree --root-element-first --generate-serialization
> > --generate-from-base-ctor --generate-default-ctor v4.xsd
> >
> > using the classes,i filled in the values...
> >
> > Now how to i make these classes into XML??? or print as an XML.
>
> You would use serialization functions for that which are generated
> when you specify the --generate-serialization option. Take a look
> at Section 2.5, "Adding Serialization" in the C++/Tree Mapping
> Getting Started Guide for a quick overview:
>
> http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#2.5
>
> For more a detailed information, see Chapter 6, "Serialization" in
> the same document:
>
> http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#6
>
> There are also a number of examples that demonstrate how to save the
> object model to XML. The 'library' example in the examples/cxx/tree/
> directory would be a good start.
>
> Boris
>
>



More information about the xsd-users mailing list