[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Processing multiple lists
Tempore 17:00:22, die 09/07/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Emerson, Matt <Matt.Emerson@xxxxxxx>:
That seems like a reasonable approach. Do you know how I could construct the string from the nodeset? Suppose the input is: <root> <list1> <node id="1">....stuff....</node> <node id="2">....stuff....</node> <node id="3">....stuff....</node> <node id="4">....stuff....</node> <node id="5">....stuff....</node> <node id="6">....stuff....</node> </list1> <list2> <node id="1">....stuff....</node> <node id="2">....stuff....</node> <node id="3">....stuff....</node> <node id="4">....stuff....</node> <node id="5">....stuff....</node> <node id="6">....stuff....</node> </list2> <list3> <node id="1">....stuff....</node> <node id="2">....stuff....</node> <node id="3">....stuff....</node> <node id="4">....stuff....</node> <node id="5">....stuff....</node> <node id="6">....stuff....</node> </list3> </root> Than you can construct the test-result string with: <xsl:variable name="test-result"> <xsl:for-each select="/root/list2/node"> <xsl:value-of select="number(@id mod 2=0)"/> </xsl:for-each> </xsl:variable> The test itself is contained inside the 'number()' function. In this example it checks wether the id number is even or odd, producing '010101' ('1' and '0' are easier to construct than 'Y' and 'N' - no additional tests needed) regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) B+In the land of the blind, the one-eyed man is kingB;
|
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
|