Hi all,
I want to retrieve specific nodes and create a new xml from that.
I have XML file as shown below:I need output xml for a given shop number. Let's say the user wants to know about shop no: 1000, then the output xml should be:Code:<log> <ID>1502</ID> <Brand>green</Brand> <Type>fruits</Type> <FruitsInfo> <ShopNo>1000</ShopNo> <date>18-Apr-2005</date> <time>16:14:22<time> <Stock> <item>Banana</item> <item>Apple</item> <item>Grapes</item> <item>Mango</item> <item>Others</item> </Stock> </FruitsInfo> <FruitsInfo> <ShopNo>1001</ShopNo> <date>18-Apr-2005</date> <time>16:14:22<time> <Stock> <item>Banana</item> <item>Apple</item> <item>Grapes</item> <item>Mango</item> <item>Others</item> </Stock> </FruitsInfo> </log>i.e., I want to extract all nodes for given shop no and all the lines/nodes before "FruitsInfo" node.Code:<log> <ID>1502</ID> <Brand>green</Brand> <Type>fruits</Type> <FruitsInfo> <ShopNo>1000</ShopNo> <date>18-Apr-2005</date> <time>16:14:22<time> <Stock> <item>Banana</item> <item>Apple</item> <item>Grapes</item> <item>Mango</item> <item>Others</item> </Stock> </FruitsInfo> </log>
Thanks in advance.
Kanna.




Reply With Quote