This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Problem in define Node-set from variable number of params
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] Problem in define Node-set from variable number of params
- From: "Yang" <sfyang at unisvr dot net dot tw>
- Date: Thu, 29 Mar 2001 13:11:43 +0800
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi,
I have following problems in using variable params to define a node-set
variable
and need your kind advice.
First I use the the variable "condition" which is from a predefined
**select** attribute
and it works fine when applying it to named template of productset.
But when I use the variable of "condition2" generated from various params
test, it fails.
Please someone offers helpful explanations and solutions. Thanks.
The portion of xslt codes shown below for your reference;
<xsl:variable name="condition"
select="key('prodCode',$thisPP)[substring(@SalesOrderNo,10,2)=$month]"/>
<xsl:variable name="condition2"><xsl:attribute name="select">
<xsl:choose>
<xsl:when test="string($office) and
string($month)">key('prodCode',$thisPP)[substring(@SalesOrderNo,1,4)=$office
][substring(@SalesOrderNo,10,2)=$month]</xsl:when>
<xsl:when
test="string($office)">key('prodCode',$thisPP)[substring(@SalesOrderNo,1,4)=
$office]</xsl:when>
<xsl:when
test="string($month)">key('prodCode',$thisPP)[substring(@SalesOrderNo,10,2)=
$month]</xsl:when>
<xsl:otherwise>key('prodCode',$thisPP)</xsl:otherwise>
</xsl:choose></xsl:attribute>
</xsl:variable>
<xsl:call-template name="productset">
<xsl:with-param name="datas" select="$condition"/> <!-- this one works
with predefined conditions.-->
<xsl:with-param name="datas" select="$condition2"/> <!-- this created
condition won't work.-->
</xsl:call-template>
Sun-fu Yang
sfyang@unisvr.net.tw
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list