Re: [xsl] Novice Question - matching entire text children

Subject: Re: [xsl] Novice Question - matching entire text children
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 20 Dec 2010 13:15:36 +0000
On 20/12/2010 13:09, David Lee wrote:
XSLT 2.0
I have a problem (probably my own misuse of XSLT) but I run into cases where

<xsl:template  match="NODE/text()">


can match more then once in a row.   I have not debugged this yet to
determine if something more complex is really the culprit (probably is),
and the text nodes matched seem to be whitespace  " \n\t .."
But before I really start digging maybe someone could tell me offhand what
the *expected* behaviour is ?

If I have an element lik


is <xsl:template match="NODE/text()">

*supposed* to be called once and only once with the entire text children or
is it possible that it is called multiple times with chunks of data as the
processer sees fit. ?

The xpath data model never has empty text nodes in a document or adjacent text nodes, they have to be merged appropriately.

So text() should match the entire text node. matching text() is a pretty rare thing to need to do though (and makes your code fragile if for example there are any comments in the file, then the text nodes are split either side of the comment.)


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

Current Thread