W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2002

contstraint on attribute combination?

From: Sonja Löhr <sonjaloehr@onlinehome.de>
Date: Sun, 20 Jan 2002 06:37:48 -0500 (EST)
Message-ID: <000701c1a1a6$550f6580$83bce23e@chakra>
To: <xmlschema-dev@w3.org>
Hi, all,

Is there any way to require that some attributes must to occur together?
I have an element "Get" the semantics of which and therefore the attributes
required depend on the attribute ("source"). I created attributeGroups each
with another fixed value for the required "source" attribute, but
unfortunately one cannot embed attributeGroups in <choice> elements or some
other representation with "or" semantics.
I then created a complexType with each of the attributeGroups and a group
like that
<group name="SomeGetElement">
    <choice>
        <element name="Get" type="GetType1"/>
        <element name="Get" type="GetType2"/>
        <element name="Get" type="GetType3"/>
    <choice>
</group>

but got an Error because of a "Unique Particle Attribution" violation. I
don't want to specify "xsi:type" in the instance document, but is there any
way out without breaking up my "Get" element into multiple elements?

Thanks an advance,
Sonja
Received on Monday, 21 January 2002 20:59:06 GMT

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