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

d2d2xs: NMTOKEN vs. string

From: Stanley Guan <Stanley.Guan@oracle.com>
Date: Mon, 03 Dec 2001 13:04:45 -0800
Message-ID: <3C0BE8ED.41584917@oracle.com>
To: Schema XML <xmlschema-dev@w3.org>
CC: Joerg.Rieger@informatik.med.uni-giessen.de
Look at d2d2xs translated result.  Isn't it better to translate
   <!ATTLIST patient
                       pat_id   CDATA                  #REQUIRED
                       kennung  (intern|extern|beides) #REQUIRED
                       hausarzt IDREF                  #IMPLIED>
to:

      <xs:attribute name="kennung" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="intern" />
            <xs:enumeration value="extern" />
            <xs:enumeration value="beides" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>

instead of:

      <xs:attribute name="kennung" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="intern" />
            <xs:enumeration value="extern" />
            <xs:enumeration value="beides" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
because
   Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
Received on Monday, 3 December 2001 16:05:00 GMT

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