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

need help with XML

Status
Not open for further replies.
Mar 20, 2003
103
AU
How can I restrive the elements to a specific attribute eg. 102?

This is my XML:

<vacancy>
<job id="101">
<reference>101</reference>
<title>title 1</title>
</job>
<job id="102">
<title>title 2</title>
</job>
</vacancy>


 
Search teh forum for XMLDOM + ChildNodes. It has been covered extensively.


____________ signature below ______________
General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
You may also want to look at XPath:
e.g. [tt]//vacancy/job[@id=102]/title[/tt]

has lots of tutorials on XML, XPath XMLDOM and such like.

A smile is worth a thousand kind words. So smile, it's easy! :)
 
This is part of my script. I am getting "]" error. Can some please help. Thanks

Set objLst = objXML.selectNodes("//LOCATIONS/LOCATION[@AGENTID=10 OR @AGENTID=12]")
noOfHeadlines = objLst.length
For i = 0 To (noOfHeadlines-1)
Set objHdl = objLst.item(i)
job=objHdl.childNodes(0).text
response.write job
Next
 
>Set objLst = objXML.selectNodes("//LOCATIONS/LOCATION[@AGENTID=10 OR @AGENTID=12]")
[tt]Set objLst = objXML.selectNodes("//LOCATIONS/LOCATION[@AGENTID=10 [red]or[/red] @AGENTID=12]")[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top