Copy link to clipboard
Copied
I have a script that calls an eml page via cfhttp and would like to simply display the results. This xml structure does work
<macromedia_resources xmlns:macromedia_resources="http://www.macromedia.com/devnet/resources/macromedia_resources.dtd">
Copy link to clipboard
Copied
Probably because there is no root element, like this:
<rootElement>
<bill />
<bill />
</rootElement>
Copy link to clipboard
Copied
The doesn't work either.
<bills session="111">
<bill type="s" number="1" title="S. 1: American Recovery and Reinvestment Act of 2009" official-title="A bill to create jobs, restore economic growth, and strengthen America's middle class through measures that modernize the nation's infrastructure, enhance America's energy independence, expand educational opportunities, preserve and improve affordable health care, provide tax relief, and protect those in greatest need, and for other purposes." last-action="2009-01-07" status="calendar" />
Copy link to clipboard
Copied
Chrispilie,
The following code works for me:
<div>
<!--- convert your sample text to xml document --->
<cfxml variable="billsXml"><bills session="111">
<bill type="s" number="1" title="S. 1: American Recovery and Reinvestment Act of 2009" official-title="A bill to create jobs, restore economic growth, and strengthen America's middle class through measures that modernize the nation's infrastructure, enhance America's energy independence, expand educational opportunities, preserve and improve affordable health care, provide tax relief, and protect those in greatest need, and for other purposes." last-action="2009-01-07" status="calendar" />
<bill type="s" number="2" title="S. 2: Middle Class Opportunity Act of 2009" official-title="A bill to improve the lives of middle class families and provide them with greater opportunity to achieve the American dream." last-action="2009-01-07" status="calendar" />
</bills></cfxml>
Is billsXml an XML document? <strong><cfoutput>#isXml(billsXml)#</cfoutput></strong>
</div>
<div>
<!--- grab the web page --->
<cfhttp url="http://www.govtrack.us/data/us/111/bills.index.xml">
<!--- convert result to xml document --->
<cfxml variable="bills_xml"><cfoutput>#cfhttp.filecontent#</cfoutput></cfxml>
Is bills_xml (from govtrack.us) an XML document? <strong><cfoutput>#isXml(bills_xml)#</cfoutput></strong>
</div>
Copy link to clipboard
Copied
I have had problems in the past when using the "-" in file node/attribute names. Maybe replacing it with "_" will help.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now