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

Re: differentiation between text() and entities???

Subject: Re: differentiation between text() and entities???
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 15 Jun 2000 13:42:12 +0100 (BST)
text node with entity
> What?  XSLT requires that all continuous text is in one continuous
> text NODE?

It isn't a restriction on the input, just a way the source tree is
modelled.

A document that looks like

<a>123<b/>456</a>

a root node
  an element node with name a
    a text node with value 123
    an element node with name b
    a text node with value 456


so any adjacent characters are clumped together into text nodes and
matched by text()

This is distinct from a grove model where each character is a node that
has its own properties that may be set/queried independently

ie the above would produce a bigger tree

a root node
  an element node with name a
    a character node with value 1
    a character node with value 2
    a character node with value 3
    an element node with name b
    a character node with value 4
    a character node with value 5
    a character node with value 6


the effect of this in XSLT is that you can not match directly onto the
'2' you have to get hold of the text node and then use the substring
function to break that apart.

But note that entity expansion happens before any of this, so
<a>1&nbsp;3<b/>456</a>
still just has two text nodes, each containing a three character string,
but now the first text node has a non breaking space instead of a 2.


David


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

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-2013 All Rights Reserved.