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!

parse xml information with coldfusion 1

Status
Not open for further replies.

demiancurran

Programmer
Sep 20, 2006
19
CA
Hello,

I've been trying to display this xml information to a webpage but haven't had any success yet.

So far, I've been able to store all the page information into a variable called myXMLDoc, and successfully XMLsearched that variable... but now i'm having trouble displaying that array of information. Here's what i have so far.
Code:
<cfhttp url="[URL unfurl="true"]www.wowarmory.com/guild-info.xml?r=Gorgonnash&n=LOOM"[/URL] method="GET" resolveUrl="yes" useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2">
<cfset myXMLDoc = XMLParse(cfhttp.filecontent)>
<cfset myItems = XMLSearch(myXMLDoc, "page")>
<cfdump var="#myItems#">

When myItems is dumped .. it shows all the information intact in the array.

This is what I'm using to show the information. I'm not sure where to declare what xmltext to display
Code:
<cfscript>
selectedElements = XmlSearch(myxmldoc, "page");
for (i = 1; i LTE ArrayLen(selectedElements); i = i + 1)
writeoutput(selectedElements[i].guildinfo.XmlText & "<br>");
</cfscript>

I'm confused as to how this array should be displayed to the screen.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top