generate id grouping using xslt
Sample Xml File...
<books>
<book id="1">
<name>example</name>
<publisher>abc</publisher>
<pric>1.22</price>
</book>
<book id="2">
<name>example1</name>
<publisher>abc1</publisher>
<pric>1.23</price>
</book>
<book id="2">
<name>example1</name>
<pric>1.23</price>
</book>
<publisherNote>
<price>1.23</price>
<publisher>abc2</publisher>
</publisherNote>
<book id="1">
<name>example</name>
<publisher>abc</publisher>
<pric>1.22</price>
</book>
<book id="3>
<name>exchange</name>
<publisher>abc</publisher>
<pric>1.22</price>
</book>
I need to group book by name, publisher and pric values. for the nodes which dont have publisher should match with publisherNote with price=pric and take this pric as reference to get publisher node and group and display sum value for each of books.
Please help me as i am urgently need any solution to solve this problem.
Expected output is
<generalBooks>
<bookDetails>
<name>example</name>
<publisherDetails>abc</publisherDetails>
<amt>2.44<amt>
</bookDetails>
<bookDetails>
<name>exchange</name>
<publisherDetails>abc</publisherDetails>
<amt>1.22<amt>
</bookDetails>
<bookDetails>
<name>example1</name>
<publisherDetails>abc1<publisherDetails>
<amt>1.23</amt>
</bookDetails>
<bookDetails>
<name>example1</name>
<publisherDetails>abc2<publisherDetails>
<amt>1.23</amt>
</bookDetails>
</generalBooks>
I was trying to use generate-id concepts but i am failing becoz i had to group the publisher depending on avaliablity if not present then we have to search each of book section which has this pric match with publisherNote price value and take this publisher details and group together.
I need solution to solve this problem, if you can provide the code this would be great help for me.
Regards
Naveen.
Thanks & Regards
Naveen.
__________________
Thanks and Regards
Naveen.
|