- From: Bob Schloss <rschloss@us.ibm.com>
- Date: Thu, 25 Nov 2004 20:09:00 -0500
- To: "Tony" <tony@codefarm.com>, xmlschema-dev@w3.org
Tony, Many of us have found it useful for the XML instance documents our applications produce to simply have "information", and if we need a certain series of characters to be shown to users, we use functions in XSLT to transform the inherent value to the conventional human format before presentation. So, if you wanted to go that way, you would have a simpleType called portion. <xs:simpleType name="portion"> <xs:restriction base="xs:double"> <xs:min value="0.0"/> <xs:max value="1.0"/> </xs:restriction> </xs:simpleType> On the other hand, if you really expect the instance documents to be hand produced by human beings, and you want the percent-sign symbol at the end, then you may be able to use the regular-expression language in the pattern facet to represent this. Good Luck, Bob Scalable XML Infrastructure group IBM Thomas J Watson Research Center "Tony" <tony@codefarm.co m> To Sent by: <xmlschema-dev@w3.org> xmlschema-dev-req cc uest@w3.org Subject xml percent 11/25/2004 04:14 PM Hi, I would like to construct a percent schema type, which is a double value between 0.0 and 100.0, with a "%" character at the end. For example "39.8%". Does anyone know how I could specify such a type in an xsd file? Ideally it would be nice to support any double number (including those with an exponent) in front of the % symbol, if that is possible... Thanks, Tony
Received on Friday, 26 November 2004 01:09:15 UTC