<xsl:param name="blah" select="'...'"/> or <xsl:param name="blah">...</xsl:param>
or always pushing a default value in from the calling app. If you wish it to be blank, set it to "''", and if you want an empty node-set, set it to "/..". $blah='' is true, because an empty node-set (the default with no select) is normalized to ''. Use not($blah and $blah='') to test for this. (This fails if $blah is 'false', '0', or other boolean false indicators. More robust methods can be found online.)
Foxy
From: "Robert Koberg" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: <[EMAIL PROTECTED]> Subject: bug? test="not($anchor_idref='')" Date: Sun, 3 Aug 2003 08:20:02 -0700
Hi,
I am doing a test on a global xsl:param to see if it contains a string or nothing. The snippet below evaluates to true when no value is being passed into the anchor_idref param. If this is not the proper way to test for something like this, what is?
<!-- custom handling of anchors for our cms' link tags --> function checkAnchor() { <xsl:if test="not($anchor_idref='')"> if (null!=<xsl:value-of select="$anchor_idref"/>) { <xsl:value-of select="$anchor_idref"/>.scrollIntoView(); } </xsl:if> }
I am using:
$ java -version java version "1.4.1_03" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_03-b02) Java HotSpot(TM) Client VM (build 1.4.1_03-b02, mixed mode)
And:
org.apache.xerces.jaxp.SAXParser org.apache.xalan.processor.TransformerFactoryImpl
thanks, -Rob
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
