[Home] [By Thread] [By Date] [Recent Entries]
On 03/10/2011 22:26, G. Ken Holman wrote:
At 2011-10-03 14:19 -0700, Mark wrote:Actually, no. Both are document nodes (known in 1.0 as root nodes) having a single text node as a child.I have been using the following idiom when providing a value for C"b,EselectC"b,B in statements like <xsl:param>, <xsl:variable>, etc., when the value provided is not an xsl object. Is this correct or is some other form preferred? If the system isn't able to do some quite sophisticated optimizations, it's very likely that a tree containing a document node and a text node will be much more expensive than a simple string. They are equivalent in most situations, but not all, which means the optimizer can't always replace one with the other. The main difference is the effective boolean value: <xsl:if test="$file-type"> works differently for strings and nodes. Why write three lines of inefficient code where one line of efficient code will do the job? (Saxon will do the optimization, incidentally, if every reference to $file-type appears in a context where the value of the variable is atomized.) Michael Kay Saxonica
|

Cart



