Results 1 to 4 of 4

Thread: create xml from existing xml file - somebody help me on this please

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member csKanna's Avatar
    Join Date
    Dec 2005
    Location
    Tech-Tips-Now.com
    Posts
    339

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width