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

XSV and enumeration of QName

From: Martin Gudgin <marting@develop.com>
Date: Mon, 28 May 2001 11:47:09 +0100
Message-ID: <006e01c0e763$8c877500$0300a8c0@greyarea>
To: "XML Schema Dev" <xmlschema-dev@w3.org>
My understanding of the enumeration facet is that it works on the value
space. Hence the following schema;

<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'
            xmlns:xx='urn:foo:bar' xmlns:yy='urn:foo:baz'
            xmlns:zz='urn:foo:quux' >

  <xsd:simpleType name='myWindows'>
    <xsd:restriction base='xsd:QName'>
      <xsd:enumeration value='xx:1234' />
      <xsd:enumeration value='xx:5678' />
      <xsd:enumeration value='yy:1234' />
      <xsd:enumeration value='zz:1234' />

  <xsd:element name='windows'>
        <xsd:element name='window' maxOccurs='unbounded'>
            <xsd:attribute name='model' type='tns:myWindows' />

should validate the following instance;

<p:windows xmlns:p='urn:example-org:windows' xmlns:a='urn:foo:bar'
xmlns:b='urn:foo:baz' xmlns:c='urn:foo:quux' >
  <window model='a:1234' />
  <window model='b:1234' />
  <window model='a:5678' />
  <window model='c:1234' />

Note that the prefixes used in the instance are not the same as the prefixes
used in the schema. XSV complains, giving;

<invalid char='3' code='cvc-attribute.1.2' line='2'
resource='file:/C:/gxmlstuff/window.xml'>attribute type check failed for
{None}:model: a:1234 not in enumeration [u'1234']</invalid>

which looks to me as if it is checking the lexical space rather than the
value space...

I tried checking against MSXML 4 but it won't even read the schema doc :-(


Martin Gudgin
Received on Monday, 28 May 2001 06:48:44 UTC

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