- From: Ashok Malhotra <petsa@us.ibm.com>
- Date: Thu, 21 Dec 2000 13:22:21 -0500
- To: MarkH@i2.co.uk
- Cc: ht@cogsci.ed.ac.uk, xmlschema-dev@w3.org
Mark, try this:
<element name='exporteditems'>
<simpleType>
<list itemType="ID">
<length value="6"/>
</list>
</simpleType>
</element>
All the best, Ashok
MarkH@i2.co.uk@w3.org on 12/21/2000 12:34:54 PM
Sent by: xmlschema-dev-request@w3.org
To: ht@cogsci.ed.ac.uk, xmlschema-dev@w3.org
cc:
Subject: RE: Element containing a list of IDs
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 13:22:59 UTC