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:attributeGroup ref="strPropType"/>
      <xs:attributeGroup ref="numPropType"/>
<xs:attributeGroup name="strPropType">
   <xs:attribute name="aaa" type="xs:string" fixed="aaa" />
   <xs:attribute name="value" type="xs:string" use="required"/>
<xs:attributeGroup name="numPropType">
   <xs:attribute name="aaa" type="xs:string" fixed="iii" use="required"/>
   <xs:attribute name="value" type="xs:integer" use="required"/>
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?)
Tomasz Olchawa
Received on Tuesday, 18 October 2005 01:43:46 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:08 UTC