OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Differance between a TextNode and An AtomicValue

[ Lists Home | Date Index | Thread Index ]

At 10:15 AM 9/11/2003, sridhar dongara wrote:
>Hello I am 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 





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS