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

RE: Element containing a list of IDs

From: <MarkH@i2.co.uk>
Date: Thu, 21 Dec 2000 17:34:54 -0000
Message-ID: <1E73B637CFC3D411A12F00B0D0795DDD091459@uknts40exh01.i2.co.uk>
To: ht@cogsci.ed.ac.uk, xmlschema-dev@w3.org
Thanks Henry. I had looked at tge US States example, the spec, and all the
posts containing "<list" and couldn't see what is wrong with my stuff. I
want to do this with anonymous types (hence my following one of the posts
rather than the US States example as my template). I realise my stuff is
wrong, but not why, and therefore not how to fix it. I guess the problem is
in my failure to properly anonymise the example? 

I've just tried again starting from the example as you suggested but am
hitting the same problem. I guess I'm doing something really stupid!

Aiming slighly lower I ended up with...
    <element name='exporteditems' minOccurs='0' maxOccurs='1'>
            <simpleType>
             <list itemType="ID"/>
		 <restriction>
              <length value="6"/>
             </restriction>
            </simpleType>
    </element>

I don't want the length restriction but before getting to the point of
removing it I'm getting the same complaint from XSV...

> Invalid cvc-complex-type.1.2.4: element
{http://www.w3.org/2000/10/XMLSchema}:restriction > not allowed here in
element {http://www.w3.org/2000/10/XMLSchema}:simpleType

I'm a novice at this stuff so would appreciate even the most obvious of my
errors and misconceptions being brutally highlighted.

Thanks

Mark

> -----Original Message-----
> From: ht@cogsci.ed.ac.uk [mailto:ht@cogsci.ed.ac.uk]
> Sent: 21 December 2000 17:15
> To: MarkH@i2.co.uk
> Cc: xmlschema-dev@w3.org
> Subject: Re: Element containing a list of IDs
> 
> 
> MarkH@i2.co.uk writes:
[snip]

So look at the DTD or Schema or the spec. itself [1], or best of all
the Primer [2], where you will find

  
List Type for Six US States:

            <xsd:simpleType name="USStateList">
             <xsd:list itemType="USState"/>
            </xsd:simpleType>

            <xsd:simpleType name="SixUSStates">
             <xsd:restriction base="USStateList">
              <xsd:length value="6"/>
             </xsd:restriction>
            </xsd:simpleType>

The USStateList type is directly relevant to your needs, just copy,
change the itemType and anonymise.  The SixUSStates example shows the
way forward for a more complex case.

ht
Received on Thursday, 21 December 2000 12:41:20 GMT

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