[xml] Re: [xslt] Performance issue when matching text()|*



Hi,

Daniel Veillard wrote:
On Fri, Jan 28, 2005 at 06:00:12PM +0100, Kasimier Buchcik wrote:

Just out of curiosity; the spec says:

"text() selects all text node children of the context node"

"Function: number count(node-set)
The count function returns the number of nodes in the argument
node-set."

Why does this build 1 huge text node?


  All <xsl:value-of> translate into adding some text to the current document,
i.e. adding a text node at the current insertion point.
  And all that stylesheet does is to accumulate <xsl:value-of> on all matching
nodes.

Oops, if this is true then XSLT it's really not intuitive here, since
I would expect the expression to be evaluated from inner to outer; i.e.
"count(text())" to return a number first and _then_ this number to be
converted to a string, which is added to the output.
Strange it seems to me.

Regards,

Kasimier





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]