xs:anyAttribute validation problems
Posted: Thu Jun 15, 2006 11:22 pm
I am having an issue with Oxygen validating documents against a schema with an anyAttribute in it.
I have a XML schema that I want to have a XML element that can have an element that can take any arbitrary attribute. So I have the following in my schema:
<xs:element name="properties">
<xs:complexType>
<!--xs:attribute name="code" type="xs:string"/-->
<!--xs:attribute name="enabled" type="xs:int"/-->
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
</xs:element>
I validate a document which contains the following XML:
<element name="army01">
...
<properties code="army" enabled="1"/>
...
</element>
andI get the following validation error:
SystemID: /home/fahome/cmihaly/xml/test.xml
Location: 7:42
Description: cvc-complex-type.2.4.a: Invalid content was found starting with element 'properties'. One of '{"http://spca.fa.disney.com/sceneDescr_20060608":ref, "http://spca.fa.disney.com/sceneDescr_20060608":geoms, "http://spca.fa.disney.com/sceneDescr_20060608":anims}' is expected.
URL: http://www.w3.org/TR/xmlschema-1/#cvc-complex-type
I am not sure why I am getting this valiation error? I believe the anyAttribute is supposed to allow me to place arbitrary attributes on my properties definition. I actuallya dded the processContents="skip" which rediced the # of errors I was getting, but still did not get rid of the above.
Any help would be appreciated! By the way, XMLSpy does validate the schema, not saying that means it is right, but at least a different point of view
Thanks
Chris
I have a XML schema that I want to have a XML element that can have an element that can take any arbitrary attribute. So I have the following in my schema:
<xs:element name="properties">
<xs:complexType>
<!--xs:attribute name="code" type="xs:string"/-->
<!--xs:attribute name="enabled" type="xs:int"/-->
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
</xs:element>
I validate a document which contains the following XML:
<element name="army01">
...
<properties code="army" enabled="1"/>
...
</element>
andI get the following validation error:
SystemID: /home/fahome/cmihaly/xml/test.xml
Location: 7:42
Description: cvc-complex-type.2.4.a: Invalid content was found starting with element 'properties'. One of '{"http://spca.fa.disney.com/sceneDescr_20060608":ref, "http://spca.fa.disney.com/sceneDescr_20060608":geoms, "http://spca.fa.disney.com/sceneDescr_20060608":anims}' is expected.
URL: http://www.w3.org/TR/xmlschema-1/#cvc-complex-type
I am not sure why I am getting this valiation error? I believe the anyAttribute is supposed to allow me to place arbitrary attributes on my properties definition. I actuallya dded the processContents="skip" which rediced the # of errors I was getting, but still did not get rid of the above.
Any help would be appreciated! By the way, XMLSpy does validate the schema, not saying that means it is right, but at least a different point of view

Thanks
Chris