[xsd-users] Re: xsd-users Digest, Vol 35, Issue 9 Re: Code
generation fails for schemas with large maxOccurs values (Boris
Kolpackov)
Gordon Kramer
gkr at as-guides.com
Wed May 14 04:50:07 EDT 2008
Hi Boris,
Am Mittwoch, den 14.05.2008, 09:22 +0200 schrieb Boris Kolpackov:
> While this is definitely an option, I think it is better to fix the
> bug in Xerces-C++ since all XML Schema validation (for the C++/Tree
> mapping) is done there. Doing some of it in Xerces-C++ and some of it
> in the generated code will make it cumbersome to enable/disable
> validation as well as report validation errors consistently.
I agree with both statements. Is it possible to validate the object
model using Xercesc facilities, without having to parse the xml again?
> http://www.codesynthesis.com/pipermail/xsd-users/2008-January/001443.html
>
thanks for the insightful link.
answer to question 3:
> 3. If error correction by the application is hard/impossible then
> what is the use of in-memory validation other then to know
> whether the object model is valid/invalid?
The only application i have for validation at the moment is to check
whether the generated xml document is actually valid.
This is enforced using serialisation followed by de-serialisation.
For my application this is fast enough at the moment. So in-memory
validation is not really an issue here.
It would just be nice to call validate() before serialisation instead of
parsing the serialised xml again.
Also i can imagine using validate for simple types to reject input from
unreliable sources.
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').
I don't actually know whether this is possible though.
Best Regards,
Gordon
More information about the xsd-users
mailing list