Here's an example of getting the name out:

<cffile action="read" file="C:\cfusionmx\wwwroot\test.xml" variable="XMLFileText">

<cfset myXMLDocument=XmlParse(XMLFileText)>

<cfset name = xmlSearch(myXMLDocument, "//benefitDocument/Name")>

<cfoutput>
#name[1].XmlText#
</cfoutput>

BTW, that XML file is horribly malformed.

----- Original Message -----
From: "Bailey, Neal" <[EMAIL PROTECTED]>
Date: Thursday, September 18, 2003 2:37 pm
Subject: Parsing XML in ColdFusion - Help!!

> Hello everyone... 
> 
> This is my first post to the list... 
> 
> Hopefully someone here can help me out. I'm pretty new to XML and 
> I need to
> parse an xml page so that I can extract the information out of it and
> include this information into a different page using ColdFusion MX 
> 6.1. 
> 
> I think my main problem is just understating how it all works using
> ColdFusion. I cannot fine many resources on the net that can help 
> explainhow to do this. All I need to do is extract very little 
> data out of a XML
> file. Almost like a news feed. 
> 
> Does anyone know of any useful resources that explain Parsing XML 
> usingColdFusion MX 6.1?
> 
> The file I'm trying to parse is below. The only information I need to
> extract is the Name, TagLine and Details. I then want to show this
> information on a new page. If possible can some one give me an 
> example of
> how to do this? 
> 
> Thanks,
> Neal
> 
> 
> <?xml version="1.0" encoding="utf-16" standalone="yes" ?> 
> -<!-- 
> This file represents benefit content
>  --> 
> 
> <http://www.cds-
> source.net/DeliverContent.aspx?&consumer=uganase&password=naseweb&benefit=105BASE&association=NASE&memberlevel=Prospect&formatcode=0##>
> - <benefitDocument>
>  <Category>Business</Category> 
>  <Name>Association 105(tm) HRA</Name> 
>  <TagLine><b>The premier tax break for your small 
> business</b></TagLine> 
>  <Icon>< FREE65.gif></Icon> 
>  <Detail><i>Over $47 million in Member savings since April 1999.
> </i><br><br> This is a call you can't afford not to make. You may 
> alreadyqualify for the Association 105 Health Reimbursement 
> Arrangement (HRA), and
> by enrolling now, the service is absolutely <b>FREE</b> to new 
> NASE Members
> in the year 2003. <b>You must call to enroll.</b><br><br> Deduct 
> 100% of
> your family health insurance premiums and other medical expenses. 
> <b>Enjoyhundreds, even thousands of dollars in real tax 
> savings!</b> A typical
> customer who pays $4,000 for health insurance and $2,000 for other 
> medicalexpenses can save between $1,800 and $2,500 in taxes. 
> <br><br> Under the new
> tax law, small-business owners will be able to deduct their health 
> insurancepremiums at 100% from a federal and state income tax 
> standpoint. However,
> the Association 105 HRA will go a step further by allowing the
> small-business owner a <b>self-employment</b> tax savings as well. In
> addition, Association 105 HRA customers will also be able to 
> deduct 100% of
> their non-insured medical expenses from <b>state, federal, and
> self-employment tax.</b><br><br> The Association 105 HRA offers you
> increased flexibility, along with the ability to carry forward unused
> benefits to the next plan year!<br><br> Do you pay for any of the 
> followingmedical-related expenses? <br><br> <ul><li>Health 
> Insurance Premiums</li>
> <li>Co-Pays</li> <li>Deductibles</li><li>Long Term Care Premiums</li>
> <li>Dental</li> <li>Vision</li> <li>Chiropractic</li> <li>Doctors 
> OfficeVisits</li> <li>Prescriptions</li></ul><br>If you answered 
> "yes," you may
> qualify for the Association 105 program.</Detail> 
>  <Call2Action /> 
>  <Teaser>Deduct 100% of your family health insurance premiums and 
> othermedical expenses</Teaser> 
>  
> <CrossSell><ul><li>show_benefit.asp?benefit=105SamplePay>SamplePay</li> 
> <li>show_benefit.asp?benefit=ProTaxTalk>TaxTalk </li></ul></CrossSell> 
>  <Disclaimer><font size = 1><b>NOTE: Association 105 HRA is 
> offered by
> Benefit Administration for the Self-Employed. SamplePay and 
> Association 105
> HRA are trademarks of Benefit Administration for the Self-Employed
> (BASE).</font></b></Disclaimer> 
>  </benefitDocument>
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137621
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

Reply via email to