[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re:Re:How to robustly handle mulple conditions in xslt
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
|
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
|