[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

items as nodes or atomic values

Ronald Bourret rpbourret at rpbourret.com
Mon May 7 23:36:29 PDT 2007


  items as nodes or atomic values
I think this touches on something that took me years to understand, and 
that is that when you parse an XML document (or construct XML nodes with 
direct or indirect constructors), the result is *always* nodes and not 
atomic values, even if there is schema information present.

For example, the result of parsing or constructing:

    <price>10</price>

is always the node tree:

     Element node (name=price)
         |
     Text node (value=10)

It is not:

     Element node (name=price)
          |
     Atomic value (type=string, value=10)

and it is not (in the presence of schema information):

     Element node (name=price)
          |
     Atomic value (type=float, value=10.0)

You can, of course, convert the various nodes into atomic values, such 
as through the string() or data() functions or through casting, but they 
start out as nodes.

(Hopefully I've got this right. Please correct me if I don't...)

-- Ron

Smith, Donald T. wrote:
> I do see from the example how nodes and (atomic) values interact, but it
> seems to confirm my prior understanding of node trees since, in the
> example given, the result of the @x expression is (first) a node whose
> value is (then) atomized. So I'm still thinking initially of the node
> tree and then about how a given node value is or is not atomized. What
> I'm not tracking with is thinking of atomic values without, or apart
> from, nodes.  




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
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.