[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Summary: What is an "integer" in the text-only XML data format?
Consider an XML Schema with this top-level element declaration: <xs:element name="num" type="xs:integer"/> And an XML file that contains this: <num>44</num> Question: What is the content of the <num> element? An integer? A string? Answer: The content of the <num> element is an integer which is represented by the string 44. Explanation: The XML Schema xs:integer type has a value space and a lexical space. The value space is the set of the actual mathematical integers. The lexical space is the set of strings that represent the integers. Specifically, the lexical space is the set of strings that match this regex: [+-]?[0-9]+ The lexical mapping of xs:integer maps each string representation (also called a literal, this is what appears in XML as text) to an integer value in the value space. The string 44 matches the regex. Therefore it is in the lexical space of xs:integer and therefore it represents the corresponding integer. Acknowledgements Thank you to the following people for their contribution to this discussion: Roger Costello Peter Flynn Ghislain Fourny Michael Sperberg-McQueen [Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|