• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

Convert cfdump results to html for display

How do you convert cfdump resaults to html? I see the xml view with the green display, but how do I transform that into html? DO I have tio use xsl or is there another coldfusion way that I'm not aware of?
0
asaworker
Asked:
asaworker
  • 2
  • 2
1 Solution
 
marklorenzCommented:
This may help:

Coldfusion 8 has changed the behavior of the CFDUMP tag adding a few additional attributes
http://www.garyrgilbert.com/blog/index.cfm/2007/7/30/Coldfusion-8-CFDUMP
0
 
asaworkerAuthor Commented:
This won't help me since I'm on 7 :(
0
 
Scott BennettManager TechnologyCommented:
cfdump always outputs html. All cfdump does is give you a graphical view of what is in a variable. a Green table indicates your variable contains an array. if you want to output and array into html you can just use cfloop to out put it's contents.


I assume you are refering to the dump in the last question I answered for you so here is the way you would get the data you need from your particular xml:

<cfoutput>
<cfloop from="1" to="#arraylen(SearchByTerm)#" index="i">
      <cfdump var="#xmlparse(SearchByTerm[i])#">
      <cfset TermXML = xmlparse(SearchByTerm[i])>
      <b>Category:</b> #TermXML.glossaryitem.XmlAttributes.category#<br>
      <b>Term:</b> #TermXML.glossaryitem.term.xmlText#<br>
      <b>Definition:</b> #TermXML.glossaryitem.definition.xmlText#<br><br>
</cfloop>
</cfoutput>
0
 
Scott BennettManager TechnologyCommented:
You can take the dump I put in there out too so it would just be like:

<cfoutput>
<cfloop from="1" to="#arraylen(SearchByTerm)#" index="i">
      <cfset TermXML = xmlparse(SearchByTerm[i])>
      <b>Category:</b> #TermXML.glossaryitem.XmlAttributes.category#<br>
      <b>Term:</b> #TermXML.glossaryitem.term.xmlText#<br>
      <b>Definition:</b> #TermXML.glossaryitem.definition.xmlText#<br><br>
</cfloop>
</cfoutput>
0
 
asaworkerAuthor Commented:
Thanks Sbettet, I was close but this is exactly was I was looking for. I was getting the results into html but not as nice as this example.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now