[xsl] Using condition expression with an empty string variable

Subject: [xsl] Using condition expression with an empty string variable
From: "Yang" <sfyang@xxxxxxxxxxxxx>
Date: Thu, 21 Jun 2001 19:20:56 +0800

I have applied the following condition expression successfully to my job.
And this expression pattern is suggested by Jeni back in May xsl


  which   is supposed to handle situations as:
  when variable **office** is a given string,  then the condition will be
  when variable **office** is an empty string, then the condition will not
be used.

  Now I try to apply the expression to a simple case like example below,
  it does not function correctly for the given empty string,  it produces a
  set of empty nodes instead.   Why?

Would  anyone provide some suggestions?

  ** xml  **
<?xml-stylesheet href="test.xsl" type="text/xsl"?>
<z-row FacilityID="xxx" ProductID="aaa"/>
<z-row FacilityID="yyy" ProductID="bbb"/>
<z-row FacilityID="zzz" ProductID="ccc"/>

**  xsl ***
<xsl:stylesheet version="1.0"
<xsl:output method="xml" indent="yes"/>

<xsl:template match="/">
<xsl:variable name="office" select="''"/> <!-- input an empty string -->
<xsl:variable name="xx"
<xsl:copy-of select="$xx"/>


  Sun-fu Yang,


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread