Subject: Re: [xsl] Providing a value for the 'select' attribute From: Michael Kay <mike@xxxxxxxxxxxx> Date: Mon, 03 Oct 2011 23:45:54 +0100 |
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?
<xsl:param name="file-type"> <xsl:text>.htm</xsl:text> </xsl:param>
The above is a text node, as is this:
<xsl:param name="file-type">.htm</xsl:param>
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.
This is slightly different in that it is a string:
<xsl:param name="file-type" select="'.htm'"/>
But for your use that difference is nuanced based only on how the item is stored in memory.
Michael Kay Saxonica
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Providing a value for the, Liam R E Quin | Thread | Re: [xsl] Providing a value for the, Wendell Piez |
Re: [xsl] Providing a value for the, Mark | Date | Re: [xsl] Providing a value for the, Michael Kay |
Month |