I have just read through this tutorial on XSD 1.1 assertions:
http://www.ibm.com/developerworks/library/x-xml11pt2/
I copied one of their examples and created this xsd
file:
<?xml version="1.1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="dimension">
<xs:complexType>
<xs:attribute name="height" type="xs:int"/>
<xs:attribute name="width" type="xs:int"/>
<xs:assert test="@height = @width"/>
</xs:complexType>
</xs:element>
</xs:schema>
I am trying to parse this to code-gen an hxx file using CodeSynthesis XSD XML Schema to C++ compiler 4.0.0 using the following command:
/path/to/binary cxx-tree /path/to/file.xsd
but I get the following error:
/path/to/file.xsd:7:41: error: invalid element 'assert' in complex type definition
I get the same error when I change the xml version to 1.0
. As I understand it the xml version shouldn't matter in this case, but I might be wrong.
What would cause this error message, and how can I fix it?