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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML, Checking Record Existence...

Status
Not open for further replies.

rjonesX

Technical User
Jun 18, 2001
56
US
I have a simple task...

Ive got a simple xml file with the following structure...

<addresses>
<contact>
<field id=&quot;email&quot;>
<field_value>russ@rjonesx.com</field_value>
</field>
</contact>
<contact>
<field id=&quot;email&quot;>
<field_value>another@rjonesx.com</field_value>
</field>
</contact>
</addresses>

Now I just need a simple ASP script that cycles through the &quot;contacts&quot; to see if an email exists. Such as...

search.asp?xml=another@rjonesx.com

if it finds the email address, it uses response.redirect(&quot;approved.html&quot;)

if not

response.redirect(&quot;register.html&quot;)

Any ideas?

 
selectSingleNode(&quot;//field_value/text() = '&quot;+xml+&quot;'&quot;);

will return null/empty or something like that when it cant find any nodes that match the xpath expression.


hope that helps..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top