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

RE: Schema for Point Value

From: Ashok Malhotra <ashokma@microsoft.com>
Date: Thu, 14 Aug 2003 07:18:03 -0700
Message-ID: <E5B814702B65CB4DA51644580E4853FB0A3CBE39@red-msg-12.redmond.corp.microsoft.com>
To: "Tanner, Thomas L." <Tom_Tanner@cinmach.com>, "W3C XML Schema Comments list" <www-xml-schema-comments@w3.org>
You can define a list datatype consisting of float values with a length
of 3.

 

Or you could write a Schema that would validate the following markup:

 

<point>

    <coordinate> 50.0000</coordinate>

    <coordinate> 50.0000</coordinate>

    <coordinate> 10.0000</coordinate>

</point>

 

All the best, Ashok 

________________________________

From: www-xml-schema-comments-request@w3.org
[mailto:www-xml-schema-comments-request@w3.org] On Behalf Of Tanner,
Thomas L.
Sent: Thursday, August 14, 2003 6:50 AM
To: W3C XML Schema Comments list
Subject: Schema for Point Value

 


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 10:18:31 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:09:00 UTC