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

Re: XML basics

  • From: David Carlisle <davidc@nag.co.uk>
  • To: xml-dev@lists.xml.org
  • Date: Tue, 01 Mar 2011 15:02:38 +0000

Re:  XML basics
On 01/03/2011 14:05, Michael Sokolov wrote:
> Yeah, this anti-node bias has me confused, too. node() gets used in all
> kinds of XML APIs like xpath and xquery, and it seems to mean pretty
> much the same thing there, and is a useful term.  I must be missing some
> subtle source of confusion?

It's confusing to talk of nodes in the original source document, nodes 
are what you get (conceptually) after the document is parsed and you 
have a tree of some sort to operate on.

You can't have half a node, or open a node but not close it, but you can 
have a start tag without an end tag (in error, or just while editing the 
file).

So I agree with Simon that when discussing XML syntax it is far better 
to talk of tags, elements, attributes, rather than nodes.

Systems that work with tags and xml syntax allow you do do

if (something)
  write "<foo>"
else
   write "<bar>"
fi

....

and people who don't have the differences between tags and nodes in 
their mind try to do this all the time in xslt

<xsl:when test="something">
  <foo>
</xsl:when>
<xsl:otherwise>
   <bar>
</xsl:otherwise>

Of course one way of describing the above error is just to say an xslt 
file has to be well formed xml, and that isn't, which is true, but 
people who make that error typically are making it because conceptually 
they are trying to output tags into a serialised result whereas xslt 
wants them to construct nodes in a tree.


David






________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________


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