D
david.n.holley
I am building an application that retrieves data from an external XML
page, and I need to retrieve an important variable that is not outside
of the root name.
For instance, say I want to retrieve the amount (3) from
"Ingredient" (see below) - since it isn't outside of the root name,
how can I achieve this??
<title>Sue's Good Pie</title>
<date>January 3, 2007</date>
<makes>1 Pie</makes>
<ingredient amount="3" unit="cups">Flour</ingredient>
<instructions>
<step>1. Blend 6 Rhubarbs for 3 Minutes.</step>
If you can point me to some resources that can explain this, I'd
greatly appreciate it.
If you're interested in looking at my code for the ASP page, its
posted below:
<%Set xmlDOM = Server.CreateObject("MSXML2.DOMDocument")
xmlDOM.async = False
xmlDOM.setProperty "ServerHTTPRequest", True
xmlDOM.Load("thisrecipe.xml")
'Get all of the <item> tags in the feed
Set itemList = xmlDOM.getElementsByTagName("recipe")
strHTML = strHTML & ""
'Iterate over each item
For Each item In itemList
'Parse the item children
For each child in item.childNodes
Select case lcase(child.nodeName)
case "title"
title = child.text
case "submittedby"
submittedby = child.text
case "makes"
makes = child.text
case "date"
datesubmitted = child.text
End Select
Next %>
page, and I need to retrieve an important variable that is not outside
of the root name.
For instance, say I want to retrieve the amount (3) from
"Ingredient" (see below) - since it isn't outside of the root name,
how can I achieve this??
<title>Sue's Good Pie</title>
<date>January 3, 2007</date>
<makes>1 Pie</makes>
<ingredient amount="3" unit="cups">Flour</ingredient>
<instructions>
<step>1. Blend 6 Rhubarbs for 3 Minutes.</step>
If you can point me to some resources that can explain this, I'd
greatly appreciate it.
If you're interested in looking at my code for the ASP page, its
posted below:
<%Set xmlDOM = Server.CreateObject("MSXML2.DOMDocument")
xmlDOM.async = False
xmlDOM.setProperty "ServerHTTPRequest", True
xmlDOM.Load("thisrecipe.xml")
'Get all of the <item> tags in the feed
Set itemList = xmlDOM.getElementsByTagName("recipe")
strHTML = strHTML & ""
'Iterate over each item
For Each item In itemList
'Parse the item children
For each child in item.childNodes
Select case lcase(child.nodeName)
case "title"
title = child.text
case "submittedby"
submittedby = child.text
case "makes"
makes = child.text
case "date"
datesubmitted = child.text
End Select
Next %>