Using
<xsl:param name="any">
<xsl:value-of select="anyExpression"/>
</xsl:param>
is mostly not the optimum. It will create a Result Tree Fragment, where it is not needed. Using
<xsl:param name="any" select="anyExpression"/>
is shorter and is of a "normal" data type like node set, string or number. While working with strings it's only a question of conversions the processor has to do. But when working with node sets it can be really a problem:
<xsl:param name="any">
<xsl:copy-of select="anyExpressionThatReturnsANodeset"/>
</xsl:param>
You can't operate on $any like on a node set. Only string operatrions are allowed. So for example "$any/path/to/a/node" is not possible.
Another problem:
<xsl:variable name="emptyString" select="''"/>
<xsl:variable name="emptyRTF">
<xsl:value-of select="''"/>
</xsl:variable>
<xsl:if test="$emptyString"/> ==> false
<xsl:if test="$emptyRTF"/> ==> true
You can't test that simply on the emptyness of a RTF, because it returns always true. You must explicitely convert it into a string via test="string($emptyRTF)".
http://www.w3.org/TR/xslt#section-Result-Tree-Fragments
So in general it's better to avoid RTFs.
Regards,
Joerg
Scherler, Thorsten wrote:
Hello group, if anybody need a date translation, here it is:e.g. test.html?date=29.1.2003 (like we write in Germany) will be 1/29/2003. <xsl:param name="date"/> <xsl:param name="GETday"><xsl:value-of select="substring-before($date,'.')"/> </xsl:param> <xsl:param name="GETmonth_year"><xsl:value-of select="substring-after($date,'.')"/></xsl:param> <xsl:param name="GETmonth"><xsl:value-of select="substring-before($GETmonth_year,'.')"/> </xsl:param> <xsl:param name="GETyear"><xsl:value-of select="substring-after($GETmonth_year,'.')"/> </xsl:param> ... <xsl:value-of select="$GETmonth"/>/<xsl:value-of select="$GETday"/>/<xsl:value-of select="$GETyear"/> King regardsMit freundlichem Gruss, Thorsten Scherler
--------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>