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

Parsing XML with attributes

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
here's my XML doc...

<?xml version=&quot;1.0&quot; ?>

<links>
<link url=&quot; 1</link>
<link url=&quot; 2</link>
</links>

here's my ASP code...

<%
'create XML server object

Dim objXMLDom
Set objXMLDOM = Server.CreateObject(&quot;Microsoft.XMLDOM&quot;)

'provide location of quick links XML doc

objXMLDOM.async = False
objXMLDom.load(Server.MapPath(&quot;../data-store/quick_links.xml&quot;))

Dim objChild

'display each link

For Each objChild in objXMLDOM.documentElement.childNodes
%>
<a class=&quot;lft_nv&quot; href=&quot;<%=objChild.text%>&quot; target=&quot;_new&quot;><%=objChild.text%><br>
<%
Next

'clear server object

Set objXMLDom = Nothing
%>

Currently, this only displays the values inbetween the <link></link> tag (aka the link name). However, how can I alter the code so I can get the value of the URL attribute?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top