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

Re: Differance between a TextNode and An AtomicValue


atomicvalue node
At 10:15 AM 9/11/2003, sridhar dongara wrote:
>Hello I a´m doing my master's thesis on Upadting XML.
>
>I have confusion between a TextNode and an AtomicValue as it is specified 
>in 
><http://www.w3.org/TR/xpath-datamodel/>http://www.w3.org/TR/xpath-datamodel/

A TextNode is a node in a document. An AtomicValue is a value, which is not 
a node in a document.

Consider the following:

         <foo>5</foo>

This contains a TextNode with the character "5". Now consider the following 
expression:

         5 * <foo>5</foo>

This evaluates to the AtomicValue 25, which has a value and a type. An 
AtomicValue is not found in a document, but a Data Model instance can 
contain both nodes and values.

This quote from the XQuery document may be helpful:

>The value of an expression is always a 
><http://www.w3.org/TR/xquery/#dt-sequence>sequence.[Definition: A sequence 
>is an ordered collection of zero or more 
><http://www.w3.org/TR/xquery/#dt-item>items.] [Definition: An item is 
>either an <http://www.w3.org/TR/xquery/#dt-atomic-value>atomic value or a 
><http://www.w3.org/TR/xquery/#dt-node>node.] [Definition: An atomic value 
>is a value in the value space of an XML Schema atomic type, as defined in 
><http://www.w3.org/TR/xquery/#XMLSchema>[XML Schema] (that is, a simple 
>type that is not a list type or a union type).] [Definition: A node is an 
>instance of one of the seven node kinds described in 
><http://www.w3.org/TR/xquery/#datamodel>[XQuery 1.0 and XPath 2.0 Data 
>Model].] Each node has a unique node identity. Some kinds of nodes have 
>typed values, string values, and names, which can be extracted from the 
>node. The <http://www.w3.org/TR/xquery/#dt-typed-value>typed value of a 
>node is a sequence of zero or more atomic values. The 
><http://www.w3.org/TR/xquery/#dt-string-value>string value of a node is a 
>value of type xs:string. The name of a node is a value of type xs:QName.

Hope this is helpful,

Jonathan 


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.