|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] LimitPredicate
Hallo, I am having trouble detecting specific nodes in a node-set that appear on a standard frequency. For example, i have the following node-set which always comprises of a number of ITEM nodes multiple to three.So i can have 3 or 6 or 9 etc, but i don't know the exact number each time because this xml is produced dynamically.In this particular example i have exactly 15 ITEM nodes. <ITEMS> <ITEM>1</ITEM> <ITEM>2</ITEM> <ITEM>5</ITEM> <ITEM>7</ITEM> <ITEM>2</ITEM> <ITEM>5</ITEM> <ITEM>10</ITEM> <ITEM>2</ITEM> <ITEM>5</ITEM> <ITEM>15</ITEM> <ITEM>2</ITEM> <ITEM>5</ITEM> <ITEM>17</ITEM> <ITEM>2</ITEM> <ITEM>5</ITEM> </ITEMS> Now if i want to select the values of ITEM nodes that appear for example in the 1st, 4th, 7th etch position, i use select="ITEM[position()mod 3=1].Using this predicate i get to select the numbers 1,7,10,15 and 17.What if i wanted to limit my selection and skip the third selected value ,that is 10, and get to select all the others.How do i do this, i mean select all ITEM contents whose position is denoted by mod 3 =1, except for the third of these particular items whose content is 10.Is there a way to further limit the predicate syntax to achieve this.A similar task would be to just select the fourth of the nodes that their position is like mod 3 =1, and simply select the value 15 in this particular example.How can i declare this with XPath.I mean can i write something like select"ITEM[position() mod 3 = 1](4) to select just the fourth node among the particular nodes.I know that what i just wrote is incorrect, but how can this be done correctly?? Regards Manousos Athens
|
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
|

Cart








