hello,
i m new to the enthralling world of xml,xslt so guys pls help.
What will be the xsl file of the following.I have an xml input
<root>
<element name="sam" number="1"/>
<element name="sam" number="2"/>
<element name="sam" number="3"/>
<element name="bob" number="5"/>
<element name="bob" number="7"/>
</root>
and the output which i want is
<root>
<element name="sam" number="6"/>
(1+2+3 =6 for attribute name="sam")------comment
<element name="" number="1"/>
<element name="" number="2"/>
<element name="" number="3"/>
<element name="bob" number="12"/>
(5+7 = 12 for attribute name="bob")------comment
<element name="" number="5"/>
<element name="" number="7"/>
</root>
As u can see, whenever the value of name attribute changes a new row should be added before, with the sum of their number attributes, and until the next name attribute change the name attributes must be blanked out...
Actually this will be used for grouping in a list.
i m new to the enthralling world of xml,xslt so guys pls help.
What will be the xsl file of the following.I have an xml input
<root>
<element name="sam" number="1"/>
<element name="sam" number="2"/>
<element name="sam" number="3"/>
<element name="bob" number="5"/>
<element name="bob" number="7"/>
</root>
and the output which i want is
<root>
<element name="sam" number="6"/>
(1+2+3 =6 for attribute name="sam")------comment
<element name="" number="1"/>
<element name="" number="2"/>
<element name="" number="3"/>
<element name="bob" number="12"/>
(5+7 = 12 for attribute name="bob")------comment
<element name="" number="5"/>
<element name="" number="7"/>
</root>
As u can see, whenever the value of name attribute changes a new row should be added before, with the sum of their number attributes, and until the next name attribute change the name attributes must be blanked out...
Actually this will be used for grouping in a list.
Comment