W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2001

Attribute Restriction

From: Curtis Hatter <cmhatter@andersonpublishing.com>
Date: Mon, 5 Mar 2001 12:54:03 -0500
Message-ID: <001001c0a59d$48d34df0$4764a8c0@editorial.andersonpublishing.com>
To: <xmlschema-dev@w3.org>

Currently working on a schema where I defined a top level complexType called caseSegmentDef. This type contains an attribute which references an enumeration of values. Here's a trimmed down example:

<xsd:complexType name="caseSegmentType">
    <!-- complexContent here -->
    <xsd:attribute name="type" type="caseSegmentType" />

<xsd:simpleType name="caseSegmentType">
    <xsd:restriction base="xsd:string">
        <xsd:enumeration value="concur" />
        <xsd:enumeration value="dissent" />
        <xsd:enumeration value="judge" />
        <xsd:enumeration value="opinion />
        <!-- more values here -->

The actual question I have is inside the top level element case i want to reference caseSegmentDef, but to make it appear in a certain sequence depending on the attribute (caseSegmentType). I read through XML Schema Part 0: Primer and while some of the things looked promising none of them seemed to work for what i'm trying to do. Here's the top level element (haven't gotten very far):

<xsd:element name="case">
            <!-- here i want to order the caseSegment elements based on the attribute -->
    <xsd:attribute name="newCase" type="xsd:boolean" />
    <xsd:attribute name="reported" type="xsd:boolean" />

Thanks for any help you can provide and sorry if I wasn't very clear.

Curtis Hatter
Received on Monday, 5 March 2001 13:01:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:51 UTC