Adrian,
That worked, thank you.  But, why can't I access the elements the way I had
it?  I have used that method many times before with no problems.  Is there
something wrong with the XML that was sent to us?

Dave 

-----Original Message-----
From: Adrian Lynch [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 28, 2007 6:37 AM
To: CF-Talk
Subject: RE: XML Help

Have a look at using XMLSearch

<cfsavecontent variable="x"><?xml version="1.0" standalone="no"?> <!DOCTYPE
schema SYSTEM "http://devweb0010.propay.com/PPResponse";>
<XMLResponse>
  <XMLTrans>
    <transType>02</transType>
    <invNum>pp1</invNum>
    <status>00</status>
    <transNum>2</transNum>
  </XMLTrans>
</XMLResponse></cfsavecontent>

<cfset x = XMLParse(x)>

<cfdump var="#x#">

<cfset status = XMLSearch(x, "/XMLResponse/XMLTrans/status")>

<cfdump var="#status[1].XmlText#">

Adrian
http://www.adrianlynch.co.uk/

-----Original Message-----
From: Dave Hatz [mailto:[EMAIL PROTECTED]
Sent: 28 December 2007 14:14
To: CF-Talk
Subject: XML Help


I am having a hell of a time trying to figure out what I am doing wrong with
the following XML:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE schema SYSTEM "http://devweb0010.propay.com/PPResponse";>
<XMLResponse>
  <XMLTrans>
    <transType>02</transType>
    <invNum>pp1</invNum>
    <status>00</status>
    <transNum>2</transNum>
  </XMLTrans>
</XMLResponse>

I have the following CF code to parse the XML:

<cffile action="read" file="d:/inetpub/wwwroot/x2.xml" variable="infile">
<cfset x2=XmlParse(infile)> <cfdump var="#x2#"> <cfset
x=x2.XMLResponse.XMLTrans.status.XmlText>

Everytime I try to access any of the elements of the XML I get : Element
XMLRESPONSE.XMLTRANS.STATUS.XMLTEXT is undefined in X2

I have tried it with .XmlText and without .XmlText and get the same results.
When I view the CFDUMP of the XML, it looks fine.  Can someone please clue
me in on what I am doing wrong here?  I am running this on CF7 on a Windows
2003 box.

Thanks,
Dave





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295474
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to