[xsd-users] Code generation fails for schemas with large maxOccurs values

Boris Kolpackov boris at codesynthesis.com
Wed May 14 13:24:11 EDT 2008


Hi Gordon,

Gordon Kramer <gkr at as-guides.com> writes:

> Is it possible to validate the object model using Xercesc facilities,
> without having to parse the xml again?

No, unfortunately this is not possible with the current version of
Xerces-C++ and I don't think there are plans to support this in near
future.


> It would just be nice to call validate() before serialisation instead of
> parsing the serialised xml again.

Actually, in this case it is more efficient (both generated code size
and speed -wise) to combine validation and serialization. Both serializer
and validator have to "map" the object model data to XML which can take
considerable time and amount of object code.

We are currently working on another mapping similar to C++/Tree which
will support XML Schema validation in generated code for both parsing
and serialization.

With this approach it is also fairly easy to support just validation
by providing a no-op implementation of the low-level XML serializer.


> Maybe it would be an option to let xsd generate a Validator class which
> provides functions to validate all types and global elements, maybe also
> global attributes, groups ... in the schema using xercesc library (if
> requested '--with-inmem-validator').

That would require serialization to XML and re-parsing of the data. I
think for now we will concentrate on the new mapping I mention above
and see what we can learn from it in terms of user feedback. Once we
have better understanding of how people use in-memory validation, we
will be able to decide whether it makes sense to add something similar
to C++/Tree.

Boris




More information about the xsd-users mailing list