[xsd-users] Berkeley DB XML example

Boris Kolpackov boris at codesynthesis.com
Thu Dec 20 07:19:17 EST 2007


Hi Rajesh,

rmanwani at tpcsed.com <rmanwani at tpcsed.com> writes:

> I have just started using XSD. I was experimenting with ability of XSD
> to serialize an object. I have looked at libxml example given to
> understand the same.

You mean the dbxml example, right? There is no example named libxml
in the XSD distribution.

> I copied some code from the example to my source files. While I compile,
> the compiler is unable to identify the classes XmlManager, XmlDocument,
> DOMDocument. The piece of code is given below:
>
>    XmlManager manager;
>    XmlDocument doc(manager.CreateDocument());
>    doc.setname("FilterObject.xml");
>
>    // Obtain DOM representation
>
>    xerces::DOMDocument &dom_doc (*doc.getContentsAsDOM());
>    filterscreenclass_(dom_doc,*c,map);
>
> I have gone through the entire package offered by XSD but I am unable
> to locate definition for these classes in any of the header files
> included. Also, the header file DbXml.hpp mentioned in driver.cxx of
> dbxml could not be located anywhere.

The dbxml example shows how to use the C++/Tree mapping on top of
the Berkeley DB XML database (see the README file in the dbxml
directory for details). As a result you need to have Berkeley DB XML
installed before you can build the dbxml example or your own code
that uses DB XML. The DbXml.hpp header file is provided by Berkeley
DB XML. For more information and to download Berkeley DB XML, see:

http://www.oracle.com/database/berkeley-db/xml/index.html

Now, if all you want is to serialize an object to XML in a file or
an in-memory string as opposed to an XML store managed by Berkeley
DB XML, then a better example would be 'library'. Also this topic
is covered in detail in the C++/Tree Getting Started Guide, Chapter 2,
Section 2.5, "Adding Serialization" and in Chapter 6, "Serialization":

http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/

Boris




More information about the xsd-users mailing list