Re: defining a leading bullet for unordered lists

I'm not entirely sure I understand what you want, but you have probably 
forgotten that the patterns defined in XML schemas must match the entire 
thing they're matching, not just fragments of it.  Therefore, your patterns 
need to be something like:

<xs:pattern value="~.*"/>
<xs:pattern value="–.*"/>
<xs:pattern value="•.*"/>

HTH,

Pete Cordell
Codalogic
Visit http://www.codalogic.com/lmx/ for XML C++ data binding

----- Original Message ----- 
From: "Andreas Peter" <info@minimag.de>
To: "XML Schema List" <xmlschema-dev@w3.org>
Sent: Sunday, February 17, 2008 10:50 AM
Subject: defining a leading bullet for unordered lists



Hello xmlschema-developers,

I am trying to right a schema for an unordered list where the first
character must be a dot, wave dash or simple a dash. But something is
not working :-(

This is my idea:

<xs:element name="lists">
<xs:complexType>
<xs:choice>
<xs:element name="listUnordered">
<xs:complexType mixed="true">
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element name="list_dot" type="dotType"/>
<xs:element name="list_dash" type="dashType"/>
<xs:element name="list_wavedash" type="wavedashType"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="listOrdered">
<xs:complexType mixed="true">
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element name="list_level1"/>
<xs:element name="list_level2"/>
<xs:element name="list_level3"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>

<xs:simpleType name="wavedashType">
<xs:restriction base="xs:string">
<xs:pattern value="~"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="dashType">
<xs:restriction base="xs:string">
<xs:pattern value="–"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="dotType">
<xs:restriction base="xs:string">
<xs:pattern value="•"/>
</xs:restriction>
</xs:simpleType>


The problem is that the pattern for the simpleType does not work. I also
tried to use unicode characters but still the same.

Thank you for helping me,
Andreas

Received on Sunday, 17 February 2008 11:14:12 UTC