• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

XML - XMLSearch - XML to Array HELP

New Here ,
May 06, 2006 May 06, 2006

Copy link to clipboard

Copied

I am about to pull my hair out. I can't get any data out of this XML file! Any suggestions would be great.
I just can't get it to work.
I have tried everything

Sample XML:

<?xml version="1.0"?>
<ResultSet xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yahoo:lcl" xsi:schemaLocation="urn:yahoo:lcl http://api.local.yahoo.com/LocalSearchService/V3/LocalSearchResponse.xsd" totalResultsAvailable="1007" totalResultsReturned="10" firstResultPosition="1">

<ResultSetMapUrl> http://local.yahoo.com/mapview?stx=vet&csz=Atlanta%2C+GA+30305&city=Atlanta&state=GA&radius=50&ed=0o...
<Result id="30945497">
<Title>Peachtree Hills Animal Hospital</Title>
<Address>2909 Peachtree Rd Ne</Address>
<City>Atlanta</City>
<State>GA</State>
<Phone>(404)812-9880</Phone>
<Latitude>33.834109</Latitude>
<Longitude>-84.382714</Longitude>
<Rating>
<AverageRating>NaN</AverageRating>
<TotalRatings>0</TotalRatings>
<TotalReviews>0</TotalReviews>
<LastReviewDate>0</LastReviewDate>
<LastReviewIntro></LastReviewIntro>
</Rating>
<Distance>0.06</Distance>
<Url> http://local.yahoo.com/details?id=30945497&stx=vet&csz=Atlanta+GA&ed=aEc1ka160SzAlUGD3nzT439KPeL2htM...
<ClickUrl> http://local.yahoo.com/details?id=30945497&stx=vet&csz=Atlanta+GA&ed=aEc1ka160SzAlUGD3nzT439KPeL2htM...
<BusinessUrl> http://www.peachtreehillsvet.com/</BusinessUrl>
<BusinessClickUrl> http://www.peachtreehillsvet.com/</BusinessClickUrl>
<Categories>
<Category id="96928526">All Animal Services</Category>
<Category id="96928528">Veterinary Medicine</Category>
</Categories>
</Result>
</ResultSet>
TOPICS
Advanced techniques

Views

380

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 07, 2006 May 07, 2006

Copy link to clipboard

Copied

I replaced <?xml version="1.0"?> by <?xml version="1.0" encoding="UTF-8"?> and saved your sample XML as the file test.xml. Then I saved the following code as myPage.cfm. It runs.

<cfset testXMLDoc=XMLParse("C:\CFusionMX7\wwwroot\test.xml", false, "")>
testXMLDoc.ResultSet.Result.Categories.Category[1].XmlText: <strong><cfoutput>#testXMLDoc.ResultSet.Result.Categories.Category[1].XmlText#</cfoutput></strong><br><br>
Dump XML document object: <br>
<cfdump var="#testXMLDoc#">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 24, 2007 Jul 24, 2007

Copy link to clipboard

Copied

if I have multiple record how can you loop threw and display two records

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 25, 2007 Jul 25, 2007

Copy link to clipboard

Copied

LATEST
> how can you loop

Like this, using Dorothy's XML:

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation