The XML file is located on another webserver (not mine) so I need the page to somehow fetch the XML page from that server. I've been toying with cfhhtp but I'm not sure how it 'stores' it while parsing the rest of the CFM page so I can't get it working like I want.
So, I assume the cfsavecontent needs to be switched with something else, ones that's done - I guess it should all be taken care of.
Main Topics
Browse All Topics





by: SBennettPosted on 2007-08-10 at 10:02:38ID: 19671645
here is how you would parse out your xml:
esult/rows et/row")>
date#<br> refID#<br> refTypeID# <br> ownerName1 #<br> ownerID1#< br> ownerName2 #<br> ownerID2#< br> argName1#< br> argID1#<br > amount#<br > balance#<b r> reason#<br ><br><br>
<cfsavecontent variable="xmlfile"><?xml version="1.0"?>
<api version="1">
<currentTime>2007-06-21 17:49:22</currentTime>
<result>
<rowset name="entries" key="refID">
<row date="2007-06-15 14:13:00" refID="59149" refTypeID="54" ownerName1="test1" ownerID1="150337897" ownerName2="test2" ownerID2="1000131" argName1="" argID1="0" amount="-7.93" balance="190210393.87" reason=""/>
<row date="2007-06-16 13:14:00" refID="59149" refTypeID="54" ownerName1="test3" ownerID1="150337897" ownerName2="test4" ownerID2="1000132" argName1="" argID1="0" amount="-7.93" balance="190210393.87" reason=""/>
</rowset>
</result>
<cachedUntil>2007-06-21 17:49:32</cachedUntil>
</api></cfsavecontent>
<cfset MyXMLDoc = xmlParse(XMLFile)>
<cfset xmlRows = xmlSearch(MyXMLDoc,"/api/r
<cfoutput>
<cfloop from="1" to="#arraylen(xmlRows)#" index="i">
<cfset RowXML = xmlparse(xmlRows[i])>
<b>date:</b> #RowXML.row.XmlAttributes.
<b>refID:</b> #RowXML.row.XmlAttributes.
<b>refTypeID:</b> #RowXML.row.XmlAttributes.
<b>ownerName1:</b> #RowXML.row.XmlAttributes.
<b>ownerID1:</b> #RowXML.row.XmlAttributes.
<b>ownerName2:</b> #RowXML.row.XmlAttributes.
<b>ownerID2:</b> #RowXML.row.XmlAttributes.
<b>argName1:</b> #RowXML.row.XmlAttributes.
<b>argID1:</b> #RowXML.row.XmlAttributes.
<b>amount:</b> #RowXML.row.XmlAttributes.
<b>balance:</b> #RowXML.row.XmlAttributes.
<b>reason:</b> #RowXML.row.XmlAttributes.
</cfloop>
</cfoutput>
Then just use thos variables in your query