[xsd-users] Re: Fwd: problem while compiling the class generated by codesynthesis XSD2.2.3

Boris Kolpackov boris at codesynthesis.com
Mon Jul 2 10:38:04 EDT 2007


Hi Pratik,

pratik verma <smartpratik at gmail.com> writes:

> First of all thanks alot for your precious suggestion. I have done
> some manuplation and now they are not giving any error.

Great!

> I have created a dci.cxx(just to extract to top most element didl
> and item) to compile them and to extract elements just analogus to
> driver.cxx in Hello.xsd example. But the fact is that  i m giving
> schema dmp2did-2006-02l.xsd and 2vedioclips.xml  file to extract
> the element but I am not able to ectract it.
>
> struct DIDL_parser: chillout::dmp2didl::DIDLType<void,
>                                 string, // DIDLInfo
>                                 string> // Item
> [...]
>
> // Construct the parser.
> //
> xml_schema::string string_p;
> DIDL_parser DIDL_p;
>
> DIDL_p.DIDLInfo_parser (string_p);
> DIDL_p.Item_parser (string_p);

The above code snippet shows that you are trying to parse the
DIDLInfo and Item elements using the xml_schema::string parser.
This won't work: both elements are of complex types, with nested
content, etc. You will need to create parsers for each of them
in order to extract the data.

I suggest that you upgrade to 3.0.0.b2. In this version we have
implemented a new design and a number of improvements for the
C++/Parser mapping. In particular, you may be interested in:

1. The new Getting Started Guide, which is located in the
   documentation/cxx/parser/guide/ directory of the XSD
   distributions. You may want to read though it to get
   a better understanding of the C++/Parser mapping.

2. The automatic parser implementation and test driver generation.
   With this feature you can generate a sample implementation that
   prints the content of your XML file. You can then use it as
   a basis and a guide for your own implementation.

You can get 3.0.0.b2 from the XSD download page:

http://www.codesynthesis.com/products/xsd/download.xhtml

hth,
-boris




More information about the xsd-users mailing list