Subject: [xsl] Re:Re:How to robustly handle mulple conditions in xslt format From: "Yang" <sfyang@xxxxxxxxxxxxx> Date: Fri, 25 May 2001 19:34:22 +0800 |
Hi, Jeni, Thanks for nice input of building XML structure to handle multiple conditions. It is certainly a good suggestions I can use. But I start to worry about the performance problem from using the complicated predicates. Changing each variable original expressed by $xx into $variables[@name='xx'] , I have modified following predicates which have been simplified from your suggestions; <xsl:variable name="MSource" select="//z:row[---]" /> where [---] is as following; [substring(@SalesOrderNo[string($month)], 10, 2) = $month] [substring(@SalesOrderNo[string($dayID)], 12, 2) = $dayID] [substring(substring-after(@CreateDate[string($timeID)],'T'),1,2) = $timeID] [normalize-space(@SalesCode[string($salesID)])=$salesID] [normalize-space(@CustomerCode[string($customerID)])=$customerID] [normalize-space(@StoreCode[string($storeID)])=$storeID] [normalize-space(@SalesOrderNo[string($salenoID)])=$salenoID] Now the modified form like this; [substring(@SalesOrderNo[string($variable[@name='month']], 10, 2) = $variable[@name='month'] ] [substring(@SalesOrderNo[string($variable[@name='dayID'])], 12, 2) = $variable[@name='dayID']] [substring(substring-after(@CreateDate[string($variable[@name='timeID'])],'T '),1,2) = $variable[@name='timeID']] [normalize-space(@SalesCode[string($variable[@name='salesID'])])=$variable[@ name='salesID']] [normalize-space(@CustomerCode[string($variable[@name='customerID']])=$varia ble[@name='customerID']] [normalize-space(@StoreCode[string($variable[@name='storeID']])=$variable[@n ame='storeID']] [normalize-space(@SalesOrderNo[string($variable[@name='salenoID'])])=$variab le[@name='salenoID']] Will this awful expression be considered a normal one to address solution of a real world problem? Will it affect the performance? Sun-fu Yang, sfyang@xxxxxxxxxxxxx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] position of an element, Sebastian Schirmer | Thread | Re: [xsl] Re:Re:How to robustly han, Jeni Tennison |
Re: [xsl] Problem with attributes, Seema Kumar | Date | RE: [xsl] xsl:if, Michael Kay |
Month |