[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xml percent

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
Message-ID: <OF1BCFDD01.8217246A-ON85256F58.0005C172-85256F58.0006514A@us.ibm.com>
xml percent





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 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.