W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2003

Schema for Point Value

From: Tanner, Thomas L. <Tom_Tanner@cinmach.com>
Date: Thu, 14 Aug 2003 06:49:51 -0700
Message-Id: <5.1.0.14.1.20030814064946.027d05d8@localhost>
To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>

I am having trouble defining the schema necessary to validate a point which 
consists of three floating point values:

         <Point>50.000000 50.000000 10.000000</Point>

I have attempted to use the following schema definition:

         <xs:element name="Point" type="xs:float" minOccurs="0"/>

However, this works only if there is one floating point value, not 3.

I have also attempted to validate this with the following schema, with the 
base type as a string and using regular expression pattern matching:

                                 <xs:element name="Point" minOccurs="0">
                                         <xs:simpleType>
                                                 <xs:restriction 
base="xs:string">
                                                         <xs:pattern 
value='([+-]?[0-9]+\.[0-9]*((e|E)("+"|"-")[0-9]+)?)+'/>

                                                 </xs:restriction>
                                         </xs:simpleType>
                                 </xs:element>

Again, this works only if there is one floating point value, not 3.

Is there a way to define the schema to validate three floating point values?
Received on Thursday, 14 August 2003 08:50:26 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:01 UTC