[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] Problem in define Node-set from variable number of params
Subject: Re: [xsl] Problem in define Node-set from variable number of params From: "Yang" <sfyang@xxxxxxxxxxxxx> Date: Thu, 29 Mar 2001 18:22:28 +0800 |
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@xxxxxxxxxxxxx ----- Original Message ----- From: "Jarno Elovirta" <jarno@xxxxxxxxxxxx> To: "Yang" <sfyang@xxxxxxxxxxxxx> 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Problem in define Node-se, Yang | Thread | [xsl] Should we let XT fade away (L, Eric van der Vlist |
[xsl] Passing XML in parameter for , Peter . FLYNN | Date | Re: [xsl] xHTML to WML, David Carlisle |
Month |
Keywords