-
Apr 21st, 2006, 11:22 PM
#1
Thread Starter
Hyperactive Member
create xml from existing xml file - somebody help me on this please
Hi all,
I want to retrieve specific nodes and create a new xml from that.
I have XML file as shown below:
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 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>
</log>
i.e., I want to extract all nodes for given shop no and all the lines/nodes before "FruitsInfo" node.
Thanks in advance.
Kanna.
Last edited by csKanna; May 4th, 2006 at 02:52 AM.
-
Apr 22nd, 2006, 02:10 AM
#2
Re: Need Help to create a xml from existing xml file.
You should be able to apply the techniques I've shown you in your other post to this problem.
Regards,
- Aaron.
-
Apr 22nd, 2006, 09:03 PM
#3
Thread Starter
Hyperactive Member
Re: Need Help to create a xml from existing xml file.
Thanks!
But what I want to do is:
Code:
'~~~~~~~~~~~~~~~Header Part Begin~~~~~~~~~~~~~~~
<log>
<ID>1502</ID>
<Brand>green</Brand>
<Type>fruits</Type>
'~~~~~~~~~~~~~~~ Header Part End ~~~~~~~~~~~~~~~
<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>
As I told in my previous post I want to create a new xml file with header part and with nodes for a given shop no. Please refer post #1 for example output file.
The number of lines in header part may differ. Simply saying, the header part is from the very first line to the line till it finds the <FruitsInfo> node.
Thanks in advance.
-
May 4th, 2006, 02:39 AM
#4
Thread Starter
Hyperactive Member
Re: create xml from existing xml file - somebody help me on this please
somebody help me on this please
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|