Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

specific childnode exists or not check

Status
Not open for further replies.

Bob2

Programmer
Jul 3, 2000
228
SE
Hi


Is there a way to check if a childnode exists or not with vbscript?

I tryed this ...

If (objXML.childNodes.length = 0) Then

But that only check if there are any childnodes, I need to check if a specific childnode exsits.



Regards


M
 
Hi

The xml file I have looks like this ...

<?xml version=&quot;1.0&quot; ?>
<products>
<product id=&quot;1&quot; serial=&quot;2&quot;>
<id>1</id>
<version>2</version>
<artnr>123</artnr>
<artnr>456</artnr>
<artnr>789</artnr>
</product>
<product id=&quot;2&quot; serial=&quot;2&quot;>
<id>2</id>
<version>2</version>
<artnr>789</artnr>
<artnr>654</artnr>
<artnr>321</artnr>
</product>
</products>


Since there are different childnodes to the product node I need to check if the artnr childnode exsits or not. Doesnt your solution just check for the presence of childnodes over all?


Regards


M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top