Hi,

I have a large xml and need to extract some xml tags containing some 16 characters codes used in my company to identify things.
the problem is that this code is contained inside tags <Ident> and all through-out the xml the tag <Ident> also contains other stuff, I need to extract only the ones with the codes.

Example:

</Agency>
<Ident>OU_CVRD</Ident>
</Identifier>
</PartyID>
<NameAddress>

.....

</Agency>
<Ident>BLANKET</Ident>
</Identifier>
</ContactID>

......

<AgencyDescription>SupplyCentre Seller</AgencyDescription>
</Agency>
<Ident>017e4e5c-78b2-1000-afd9-40ddab0a0001</Ident>
</Identifier>
</PartyID>

and so on for several lines and more lines, as you can see the tag <Ident> is used for many things but I am only interested in the one containing that long code.

So far I am using:

var i, n_elems, elems = xml_doc.getElementsByTagName("Ident");
n_elems = elems.length;
for (i = 4; i < n_elems; i++)
document.write(elems[i].firstChild.nodeValue + "<br>" + "<br>");

but this is returning ALL <Ident> tags, how can I make this conditional?

Thanks!

Paulo