W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2000

Re: embedded space

From: Andy Palmer <Andy.Palmer@mediasurface.com>
Date: Wed, 6 Dec 2000 14:55:40 -0000
Message-ID: <02F5D2F056BDD411B3CE0004AC96F8A3224011@ntexchange.int.mediasurface.com>
To: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
Cc: "'marting@develop.com'" <marting@develop.com>
Sorry for coming in on this late, but I can't get (a variant of) the example
to work. The xml is:

<?xml version="1.0"?>
<Tester colour="dark red"

 <dummy>hello world</dummy>


The xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">

 <xsd:simpleType name="colours">
  <xsd:restriction base="xsd:string">
   <xsd:enumeration value="red"/>
   <xsd:enumeration value="dark red"/>

 <xsd:element name="Tester">
    <xsd:element name="dummy" type="xsd:string"/>
   <xsd:attribute name="colour" type="colours"/>
   <xsd:attribute name="xsi:schemaLocation" type="xsd:string"/>
   <xsd:attribute name="xmlns:xsi" use="default"
value="http://www.w3.org/2000/10/XMLSchema" type="xsd:uriReference"/>
   <xsd:attribute name="xsi:noNamespaceSchemaLocation" type="xsd:string"/>


Using XMLSpy 3.5b1 the xsd is fine, but the xml gives the error (on line 2):

"Unexpected choice 'dark red' for attribute 'colour': (red|dark|red)

What am I doing wrong (I've included everything in case I've missed
something blindingly obvious)? There's not much about this topic on the web,
but there must be loads of uses - my need is actually to limit an element to
a set of names, and that must be quite common.
Received on Wednesday, 6 December 2000 09:59:24 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:54 UTC