Chris Coyle wrote:
I tried:
<xsl:if
test="exists($productid)">
<Attribute name="PRODUCTID"
type="string"><xsl:value-of
select="$productid"/></Attribute>
</xsl:if>
but got the following error:
06:47:27.062 global (ERROR) - Uncaught Exception:
'exists' is not a valid XSLT or XPath function.
exists() is an XPath 2 function, you use an XPath/XSLT 1 parser. But
even if you weren't, it is not the right thing to do, exists($param)
will always return true(), with one exception, when the variable returns
an empty sequence:
<xsl:param name="myparam" select="()" />
or <xsl:param name="myparam" select="/.." />
then this yields false:
<xsl:if test="exists($myparam)" >....
However, with:
<xsl:param name="myparam" select=" '' " />
or <xsl:param name="myparam" select="0" />
or <xsl:param name="myparam" />
then this yields true:
<xsl:if test="exists($myparam)" >....
Cheers!
-- Abel Braaksma
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--