[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Find a set of nodes and depending on element values
Hi! I have a simple xml file: <?xml version="1.0" encoding="iso-8859-1"?> <loadtest><settings task="Export" host="http://animal:8080" format ="BMECat" size="1000" ></settings><rounds> <action><user>user0-0</user><command>completed</command><loadsize>1</loadsize><time>18</time><output></output></action> <action><user>user0-1</user><command>completed</command><loadsize>1</loadsize><time>17</time><output></output></action> <action><user>user0-2</user><command>completed</command><loadsize>1</loadsize><time>18</time><output></output></action> <action><user>user0-3</user><command>completed</command><loadsize>5</loadsize><time>18</time><output></output></action> <action><user>user0-4</user><command>completed</command><loadsize>5</loadsize><time>18</time><output></output></action> </rounds></loadtest> Now I want to find all <action> elements with the element <loadsize>1</loadsize> and then process the average time (<time>xxx</time>) for each set of action elements with the same time. <xsl:value-of select="sum(/time[loadsize='1']) div count(time[loadsize ='1'])"/> does not work... My problem is to find the correct nodeset - for-each gives me the strings , not the elements. thanks in advance! erik stunkat 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
|