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

Selecting the Value of an Node Attribute

Status
Not open for further replies.

Krus1972

Programmer
Joined
Mar 18, 2004
Messages
145
Location
US
Hi all,

I currently have the following XML node that contains an attribute:

<Details url=" url string here.com">
</details>

I would like to be able to select the text of the "url" attribute. I am using ASP XMLHTTP server object and the

selectSingleNode("details").text

What property or properties do i need to select the text contained in the "url" attrbute?

Secondly I am using a loop to select the URL's from many different <Details url=""> tags. The script looks like:

For iCount = 0 To 10
URL = XML.responseXML.selectSingleNode("ProductInfo/Details[" & CInt(iCount)& "]").text
Respond.write("<a href='URL'>" & URL & "</a>")
Next


Very simple idea here. I am just trying to read the value of the "URL" attribute in the <Details url=""> and print the results and allow the browser to hyperlink to each one when clicked. Can anyone tell me why the URL attribute is not being read in correctly from the above code?

Thank you,

Jeff




Thanks,

Jeff
 
try this

URL = XML.responseXML.selectSingleNode("ProductInfo/Details[" & CInt(iCount)& "]/@Url")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top