[xsd-users] Default values of elements that use enumerated types

Tony McConnell amnw14545 at googlemail.com
Thu Dec 10 09:08:15 EST 2015


Thank you for your prompt reply.

I've enclosed a small test case as this is where I think the problem lies.

xmllint is able to validate the t.xml against t.xsd

Yet passing the files into the xerces-c validator (t.cc) gives the same
type of exception I get from my xsd generated parsing code - leading me to
suspect it is not XSD at fault, but xerces-c.

Should libxerces-c be able to validate this?

Thank you

Tony

On Thu, Dec 10, 2015 at 1:37 PM, Boris Kolpackov <boris at codesynthesis.com>
wrote:

> Hi Tony,
>
> Tony McConnell <amnw14545 at googlemail.com> writes:
>
> > When I create some XML that has '<precipitation></precipitation>',
> xmllint
> > is happy, but the generated code produces an 'unexpected enumeration'
> > exception.
> >
> > Should XSD support default element values, or is this some problem with
> the
> > underlying xerces-c parser?
>
> This should work, provided you did not disable validation at the Xerces-C++
> level (since, unlike for attributes with default values, for elements XSD-
> generated code relies on the underlying parser to "expand" the default
> values). What is the exact error that you are getting and what do you do
> to parse this XML (i.e., show the relevant C++ fragment)?
>
> Boris
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tc.tgz
Type: application/x-gzip
Size: 27448 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20151210/e591365c/tc-0001.bin


More information about the xsd-users mailing list