Re: [xsl] A Problem with Variables and Xpath

Subject: Re: [xsl] A Problem with Variables and Xpath
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 25 Jul 2011 16:39:23 +0100
On 25/07/2011 16:13, Christian.Sisti@xxxxxxxxxxx wrote:
<xsl:variable name="foo">something</xsl:variable>

Incidentally don't do that (which makes $foo a document node with a text node child with string value "something")

do this

<xsl:variable name="foo" select="'something'"/>

which makes $foo into the string "something".

The latter is less to type and quite a bit more efficient to generate (as it doesn't have to generate two nodes with globally unique identity) and more efficient to access (as it doesn't have to be cast to a string).


-- google plus: https:/

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