Hi,
I'm just foraying into XML for the first time and working on some practice scenarios. One of these includes making a representation of a tick list in XML, where a user could select none, one or more, or all options. I was looking at using list as my option. I have seen two different ways of writing it the Wrox "Beginning XML" method:
Code:
<simpleType name=”ContactTagsType”>
<restriction base=”string”>
<enumeration value=”author”/>
<enumeration value=”xml”/>
<enumeration value=”poetry”/>
<enumeration value=”consultant”/>
<enumeration value=”CGI”/>
<enumeration value=”semantics”/>
<enumeration value=”animals”/>
</restriction>
</simpleType>
with
<simpleType name=”ContactTagsListType”>
<list itemType=”contacts:ContactTagsType”/>
</simpleType>
And the W3Schools method which is similar (but I can't seem to get to work):
Code:
<xs:element name="intvalues" type="valuelist"/>
<xs:simpleType name="valuelist">
<xs:list itemType="xs:integer"/>
</xs:simpleType>
</xs:schema>
The "intvalues" element in a document could look like this (notice that
the list will have five list items):
<intvalues>100 34 56 23 1567</intvalues>
Is there a preference of format? Also I think the latter doesn't work as I have no idea where to put the <intvalues> line :-/
Any pointers advice, would be greatly appreciated,
Gogs