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:Re:How to robustly handle mulple conditions in xslt format


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@unisvr.net.tw



 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]