[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|