define attribute as NOT a member of enumerated type

Discussion in 'XML' started by davidmcb@pacbell.net, Mar 1, 2006.

  1. Guest

    I have defined an enumerated type that I use in various places in my
    schema. I am in the process of creating a new complex type that
    contains an attribute that I want to restrict to NOT being a member of
    the enumerated type. Is this possible? How?


    For example:


    <!-- enumerated type-->
    <xs:simpleType name="myEnumeration">
    <xs:restriction base="xs:string">
    <xs:enumeration value="blah1"/>
    <xs:enumeration value="blah2"/>
    <xs:enumeration value="blah3"/>
    </xs:restriction>
    </xs:simpleType>


    <!-- complex type with attr NOT a member of the above enum-->
    <xs:complexType name="someNewType">
    <xs:sequence>
    <xs:element name="newtype">
    <xs:complexType>
    <xs:all>
    <xs:element name="alias" type="xs:string"/>
    </xs:all>
    <!-- *** here's where I want to say 'type != ' *** -->
    <xs:attribute name="name" type!="myEnumeration"/>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
     
    , Mar 1, 2006
    #1
    1. Advertising

  2. writes:

    > I have defined an enumerated type that I use in various places in my
    > schema. I am in the process of creating a new complex type that
    > contains an attribute that I want to restrict to NOT being a member of
    > the enumerated type. Is this possible? How?
    >
    >
    > For example:
    >
    >
    > <!-- enumerated type-->
    > <xs:simpleType name="myEnumeration">
    > <xs:restriction base="xs:string">
    > <xs:enumeration value="blah1"/>
    > <xs:enumeration value="blah2"/>
    > <xs:enumeration value="blah3"/>
    > </xs:restriction>
    > </xs:simpleType>


    I fear the only way to accomplish this is via an _extremely_ verbose
    and tedious regexp :-(

    ht
    --
    Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
    Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
    Fax: (44) 131 650-4587, e-mail:
    URL: http://www.ltg.ed.ac.uk/~ht/
    [mail really from me _always_ has this .sig -- mail without it is forged spam]
     
    Henry S. Thompson, Mar 6, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alastair Cameron
    Replies:
    1
    Views:
    1,593
    Colin Mackenzie
    Jul 4, 2003
  2. Nick Bassiliades

    Redefining an enumerated attribute type

    Nick Bassiliades, Dec 9, 2005, in forum: XML
    Replies:
    1
    Views:
    442
    Henry S. Thompson
    Dec 12, 2005
  3. David
    Replies:
    0
    Views:
    371
    David
    Mar 1, 2006
  4. Yevgen Muntyan

    #define ALLOCIT(Type) ((Type*) malloc (sizeof (Type)))

    Yevgen Muntyan, Feb 9, 2007, in forum: C Programming
    Replies:
    10
    Views:
    912
    Yevgen Muntyan
    Feb 13, 2007
  5. Bill Davy
    Replies:
    6
    Views:
    695
    James Kanze
    Sep 25, 2008
Loading...

Share This Page