[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Correction

Subject: RE: Correction
From: "Aron Bock" <aronbock@xxxxxxxxxxx>
Date: Tue, 17 May 2005 12:02:40 +0000
 RE: Correction
Oleg,

A little comment to that portion of your code:
 <xsl:template name="trimmed-data">
       <!-- pos of first non-zero rebate1 -->
       <xsl:variable name="pr1"
select="count(mystruct/myarray1/myvar/rebate1[. &lt;= 0]) + 1"/>

1) I don't quite get what you are calculating here, what does [. <= 0]
mean, that current node <= 0 ?

Yes--roughly, text-value of current node <= 0. Thus if we have the following sequence:


0 0 1 2 3 4 ...

The first non-zer0 number is at position 3 (XSL is 1-based), which is count(nodes-lte-0) + 1

2) It looks to me that any non-numeric nodes like <blank>, 'NaN', 'N/A', 'abc'
will break the algorithm. How can we make it a bit more robust ?


Non-numbers (in XSLT 1.0) should be OK. At the moment I can't elaborate precisely why since I'm pretty new at this myself, and haven't yet done enough reading-up on specs or semantics. Please try out by adding nodes tothe snippet I posted.


Regards,


--A

_________________________________________________________________
Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.