[xsd-users] parsing exception if attribute mixed=true is used

Boris Kolpackov boris at codesynthesis.com
Thu Apr 6 10:05:43 EDT 2006


Hi Oliver,

Oliver.Kowalke at infineon.com <Oliver.Kowalke at infineon.com> writes:

> Hello,
> I get an exception 'instance document parsing failed' if contexType has
> the attribute mixed=true and a text is inserted.

You can catch and print that exception to get more detailed error
message:

catch (xml_schema::parsing const& e)
{
  std::cerr << e << std::endl;
}

In your hello.xml you have:

<c>text</c>

While your schema has:

<xsd:complexType name="c_type" mixed="true">
  <xsd:sequence>
    <xsd:any processContents="skip"/>
  </xsd:sequence>
</xsd:complexType>


which says that there should be exactly one sub-element in element 'c'.
Obviously, your instance does not conform to this. Try changing it like
this:

<xsd:complexType name="c_type" mixed="true">
  <xsd:sequence>
    <xsd:any processContents="skip" minOccurs="0"/>
  </xsd:sequence>
</xsd:complexType>


hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060406/8cfbb5df/attachment.pgp


More information about the xsd-users mailing list