|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Crazy idea: loopback namespace
so you want to use def if foo is either not set or is set to empty
string?
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:call-template name="A"/>
<xsl:call-template name="A">
<xsl:with-param name="foo" select="'aa'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="A">
<xsl:param name="foo"/>
<xsl:call-template name="B">
<xsl:with-param name="foo" select="$foo"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="B">
<xsl:param name="foo" />
<xsl:variable name="foo2">
<xsl:choose>
<xsl:when test="$foo"><xsl:copy-of select="$foo"/></xsl:when>
<xsl:otherwise>def</xsl:otherwise>
</xsl:choose>
</xsl:variable>
[<xsl:value-of select="$foo2"/>]
</xsl:template>
</xsl:stylesheet>
bash-2.01$ xt js.xsl js.xsl
<?xml version="1.0" encoding="utf-8"?>
[def]
[aa]
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








