In answer to your second question.  Parse you xml into a CF XML object.

<cfset variables.myXMLobj = xmlParse(variables.myXML)>

Then you can do things like this.

<cfoutput>#variables.myXMLobj.Name.First.xmlText#</cfoutput>


--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

....-----Original Message-----
....From: Rebecca Wells [mailto:[EMAIL PROTECTED]
....Sent: Wednesday, July 06, 2005 3:31 PM
....To: CF-Talk
....Subject: XML question
....
....I'm trying to figure out how to handle an XML file that will be
....transmitted to my web app. Since I don't have an example of the actual
....XML file, I created a test XML document stored in the variable named
...."myXML".
....
....First, how do I access the XML document that will be posted to my web
....app (via HTTPS POST)?
....
....Second, is there any easier way to refer to an particular XML element
....as a simple value as I am attempting to do here with
...."#variable.myXMLName[1].XmlText#"?
....
....
....<cfoutput>
....Hello world.<br>
....
....<cfset variable.myXML = "<?xml
....version='1.0'?><CONTACT><NAME><FIRST>Rebecca</FIRST><LAST>Wells</LAST></N
....AME><CONTACTDETAILS>
....<EMAIL>[EMAIL PROTECTED]</EMAIL><TELEPHONE>(425)
....430-6884</TELEPHONE></CONTACTDETAILS></CONTACT>">
....
....<cfset variable.myXMLName = #XmlSearch(XmlParse(variable.myXML),
...."/CONTACT/NAME/FIRST")#>
....
....My name is <em>#variable.myXMLName[1].XmlText#.</em>
....</cfoutput>
....
....

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211293
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to