[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?

  • From: Roger L Costello <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Thu, 30 Mar 2023 11:27:22 +0000

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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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-2013 All Rights Reserved.