Well you can do the following (just one way of doing it, I'm sure there are
lots other)
1. First find the node that you want to process, you can simply do an this
XPath '//NeuStarLSRReport/NeuStarReqestList/NeuStarRequestRecieved '. This
will give you the XmlNodeCollection that you want to process.
2. Loop through that collection for each node that you want to process. For
each node you can get the attributes list (using the .Attributes property).
And then for each attributes you can build your SQL string
3. Do step 1 and 2 for the NeuStarResponseList nodes.
[quoted text, click to view] "Venkat Chellam" wrote:
> I have a XML file like as follow
>
> <?xml version="1.0" encoding="UTF-8"?>
> <NeuStarLSRReport>
> <NeuStarHeader fromDate="09/10/04" toDate="09/13/04"
> RequestsReceived ="43" ResponsesSent="50">
> </NeuStarHeader>
> <NeuStarReqestList>
> <NeuStarRequestRecieved pon="IDT2345611" ver="AA"
> dateReceived="09/10/04" />
> <NeuStarRequestRecieved pon="IDT2345615" ver="AA"
> dateReceived="09/10/04" />
> </NeuStarReqestList>
> <NeuStarResponseList>
> <NeuStarResponseSent pon="IDT2345611" ver="AA"
> dateSent="09/10/04" MessageType="Error"/>
> <NeuStarResponseSent pon="IDT2345622" ver="AB"
> dateSent="09/10/04" MessageType="Error"/>
>
>
> </NeuStarResponseList>
>
>
> </NeuStarLSRReport>
>
>
> from the above XML i need to parse the nodes inside node
> <NeuStarRequestList>
> <NueStarResponseList> node. Both these nodes can have 1 or more number
> of child nodes as described below( in above example, its just 2 for
> each of them, but they can more or less also)'
>
>
> how do i part the attributes values and i need to store them in the
> database. For each node in both the nodes(NeuStarRequestList and
> NeuStarResponseList) i need to insert a row into database table
> conatining appropriate fields
>
> any help?
>
> venky