Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

space separated list using NMTOKENS (XML Schema) 1

Status
Not open for further replies.

JeroenB

Programmer
Apr 8, 2001
93
BE
How can I define a space separated list of values for an attribute using NMTOKENS. The values one may use must be predefined!

The below code does not seem to work. The attribute value does not allow for the containment of a LIST of the values; yet appears to be restricted to one value only.

<xs:simpleType>
<xs:restriction base="xs:NMTOKENS">
<xs:enumeration value="value1"/>
<xs:enumeration value="value2"/>
<xs:enumeration value="value3"/>
<xs:enumeration value="value4"/>
<xs:enumeration value="value5"/>
</xs:restriction>
</xs:simpleType>

many thanks
j.
 
Would this construction work through?
[tt]
<xs:simpleType name="xNMTOKEN">
<xs:restriction base="NMTOKEN">
<xs:emumeration value="value1" />
<xs:emumeration value="value2" />
<xs:emumeration value="value3" />
<xs:emumeration value="value4" />
<xs:emumeration value="value5" />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="xNMTOKENS">
<xs:list itemType="xNMTOKENS" />
</xs:simpleType>
[/tt]
 
Thanks for the vote! But, you sure see I had an obvious typo up there
[tt] <xs:list itemType="xNMTOKE[highlight]N"[/highlight] />[/tt]

Also, no doubt you might have some namespace prefixes to attach to those things in case you put into practice. I just deduce it from the line of thinking in schema without testing; and you know better...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top