This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem in define Node-set from variable number of params


Hi, Jarno,

It works perfectly.  Thanks.
The expression  is a little bit of cumbersome though.  At least I got a good
xslt lesson.

Sun-fu Yang,

sfyang@unisvr.net.tw

----- Original Message -----
From: "Jarno Elovirta" <jarno@elovirta.com>
To: "Yang" <sfyang@unisvr.net.tw>
Sent: Thursday, March 29, 2001 5:36 PM
Subject: RE: [xsl] Problem in define Node-set from variable number of params


> Hip hei!
>
> > 3. for both tests are true, I get solutions but not the correct one
> > comparing with the one from using *condition* variable.
> >  I could not get logical reason for it.
> ...
> > I just did one test to figure out why the case  of
> > both (string($office) and string($month) are true
> > failed.  I deliberately removed the single case condition out of the
> > "condition2"  variable,
> > then I got good solutions. Hopefully this finding will provide you some
> > information to perfect the
> > phrase of variable "condition2".
>
> How about this, then?
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0"
>                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>
> <xsl:output method="xml" />
>
> <xsl:template match="/">
>   <xsl:variable name="condition"
>
select="key('prodCode',$thisPP)[substring(@SalesOrderNo,10,2)=$month][substr
> ing(@SalesOrderNo,1,4)=$office]"/>
>
>   <xsl:variable name="condition2"
>
select="key('prodCode',$thisPP)[substring(@SalesOrderNo,10,2)=$month][substr
> ing(@SalesOrderNo,1,4)=$office][string($office) and string($month)] |
>
>
key('prodCode',$thisPP)[substring(@SalesOrderNo,1,4)=$office][string($office
> ) and not(string($month))] |
>
>
key('prodCode',$thisPP)[substring(@SalesOrderNo,10,2)=$month][string($month)
> and not(string($office))] |
>   key('prodCode',$thisPP)[not(string($office)) and not(string($month))]"/>
>
>   <xsl:call-template name="productset">
>     <xsl:with-param name="datas" select="$condition2"/>
>   </xsl:call-template>
> </xsl:template>
>
> </xsl:stylesheet>
>
> Jarno
>


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]