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

IDREF constraint

From: Alessandro Di Bella <alessandro.dibella@eng.it>
Date: Tue, 17 Dec 2002 16:02:27 +0100
Message-ID: <3DFF3C83.8070201@eng.it>
To: xmlschema-dev@w3.org, xml-dev@lists.xml.org

Hi,
does anyone know if there is a way of constraining the value if an IDREF
attribute in order allows as values only IDS of specified elements ? For
example:
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="e1">
        <xsd:complexType>
            <xsd:attribute name="id" type="xsd:ID"/>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="e1">
        <xsd:complexType>
            <xsd:attribute name="id" type="xsd:ID"/>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="e1">
        <xsd:complexType>
            <xsd:attribute name="id" type="xsd:ID"/>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="choice1">
        <xsd:complexType>
            <xsd:sequence>
                I WANT THIS TO BE ABLE TO POINT ONLY TO IDS IG <e1> OR
<e2> ELEMENTS
                <xsd:element name="target" type="xsd:IDREF"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="choice12">
        <xsd:complexType>
            <xsd:sequence>
                I WANT THIS TO BE ABLE TO POINT ONLY TO IDS OF <e3> ELEMENTS
                <xsd:element name="target" type="xsd:IDREF"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>
Received on Tuesday, 17 December 2002 10:09:34 GMT

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