[xsde-users] XSD/e 3.0.0 released

Boris Kolpackov boris at codesynthesis.com
Fri Feb 6 10:07:15 EST 2009


Hi Filippo,

Della Betta Filippo <filippo.dellabetta at telecomitalia.it> writes:

> first of all thank you for your excellent work. I like the hybrid 
> mapping very much.

Thank you. I am glad you like it.


> I wrote the following program to test hybrid / aggregate functionality.
> While printing the name for "2nd level" list (see rl.xml), I got access
> violation (windows, visual studio 2008).

I checked your schema and XML and it appears that it has a recursive
element (list). One of the current limitations of the generated parsing
code in the C++/Hybrid mapping is that it does not yet support recursive
parsing. This will be supported in the next release, though.

One work around would be to provide custom parser implementations for
the types involved in the recursion. In your schema they are list (the
anonymous type for the list element inside listType) and listType. I've
created a sample implementation for you which you can download via this
URI:

http://www.codesynthesis.com/~boris/tmp/resource-list-rfc4826.zip

Here is what I did:

I copied the generated parser implementations for list and listType
to list-pimpl.h/cpp and listType-pimpl.h/cpp. I then changed them
to maintain a stack of states instead of just one state. I used
STL stack for simplicity, though you can use the POD stack class
found in libxsde/xsde/cxx/parser/state.hxx if STL is not available
(this is what we are going to use in the implementation for the
next release; that stack is also optimized for the non-recursive
case).

Then I used the --custom-parser option to instruct the XSD/e compiler
to use my custom implementations instead of the generated ones (see
the cmd.txt file in the archive for the updated XSD/e command line).
After that your test driver works as expected.

For more information on parser customization see Section 6.1, 
"Customizing Parsers and Serializers" in the Embedded C++/Hybrid
Mapping Getting Started Guide.

Boris



More information about the xsde-users mailing list