Identifying Parent and child Tag in XML

Identifying Parent and child Tag in XML

am 16.01.2008 22:07:01 von Umeshnath

Hi,
I have a XML file which contains some Container and item information.
Both the tag identying by the same tag (Container).
But the outer is parent one and all other are child to that parent.

In this eg total 2 parent an 4 items are there.
.By programitilly how can i Distingush.
eg :

urn:epc:id:gid:49603356.41P.000001

urn:epc:id:gid:49603356.41C.000001

urn:epc:id:gid:49603356.41C.000002




urn:epc:id:gid:49603356.51P.000001

urn:epc:id:gid:49603356.51C.000001

urn:epc:id:gid:49603356.51C.000002



Thanks in advance
Umeshnath

Re: Identifying Parent and child Tag in XML

am 19.01.2008 08:55:36 von Harshal P

I think XPath can help you here.

Another (less optimized) way might be to loop through all nodes in an
recursive fassion, if parent-child will continue deep down to an unknown
level, if level known u can set the nesting likewise.

Thanks,
Harshal

"Umeshnath" wrote in message
news:588D7EEB-054C-4DCC-ABB2-963C7F1EA34A@microsoft.com...
> Hi,
> I have a XML file which contains some Container and item information.
> Both the tag identying by the same tag (Container).
> But the outer is parent one and all other are child to that parent.
>
> In this eg total 2 parent an 4 items are there.
> .By programitilly how can i Distingush.
> eg :
>
> urn:epc:id:gid:49603356.41P.000001
>
> urn:epc:id:gid:49603356.41C.000001
>

>
> urn:epc:id:gid:49603356.41C.000002
>

>

>
>
> urn:epc:id:gid:49603356.51P.000001
>
> urn:epc:id:gid:49603356.51C.000001
>

>
> urn:epc:id:gid:49603356.51C.000002
>

>

>
> Thanks in advance
> Umeshnath