W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2005

choice attributeGroup

From: Tomasz Olchawa <thm@parasoft.com.pl>
Date: Mon, 17 Oct 2005 16:55:30 +0200
Message-Id: <200510171453.j9HEr11v027035@parasoft.com.pl>
To: <xmlschema-dev@w3.org>

I have XML format like this:
 
....
<Property name="aaa" value="string"/>
<Property name="iii" value="16"/>
....
 
I want to create XML schema  for this XML format, but I cannot do this:
 
....
<xs:element name="Property">
   </xs:choice>
      <xs:attributeGroup ref="strPropType"/>
      <xs:attributeGroup ref="numPropType"/>
   <xs:choice>
</xs:element>
 
<xs:attributeGroup name="strPropType">
   <xs:attribute name="aaa" type="xs:string" fixed="aaa" />
   <xs:attribute name="value" type="xs:string" use="required"/>
</xs:attributeGroup>
 
<xs:attributeGroup name="numPropType">
   <xs:attribute name="aaa" type="xs:string" fixed="iii" use="required"/>
   <xs:attribute name="value" type="xs:integer" use="required"/>
</xs:attributeGroup>
....
 
I cannot do this because:
cos-nonambig: "http://www.parasoft.com/GRS":Property and
"http://www.parasoft.com/GRS":Property (or elements from their substitution
group) violate "Unique Particle Attribution". During validation against this
schema, ambiguity would be created for those two particles.

 
How I can to this?
(any workaround?)
 
Regards,
Tomasz Olchawa
Received on Tuesday, 18 October 2005 01:43:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:51 GMT