I am strugling to output my xml document in an xsl format.
My xml document is created in a function, and I have another function that takes the xml and transform it to an xsl document... something is wrong somewhere the output to xsl is not happening.
My question is, how would I transform an XML document to an XSL. The outputs for both are created on the fly, thus the function returns the xml which I am using to create the xsl and saved in a cfsavecontent and then output to html. no files are saved to the drive
Can you clarify what you mean? An XSL file is already intrinsically XML, so your question is "ambiguous" if you don't show us a before and after of the requirement, as well as the code you've been working on to try to effect the solution.
Are you perhaps meaning you're trying to use XSL to transform XML into [whatever the XSL defines the transformation to be]? Again, without getting a better idea of the inputs and the outputs, it's difficult to say.
The basic form of performing an XSL transformation in CF is:
result = smlTransform(anXmlDoc, anXslDoc);
It doesn't matter if the XML or XSL are strings containing the XML / XSL, file paths that contain them, or anything else that returns either of those.
See the below files. Just to output the values of the xml to the xsl and to the page the values are not being out put and also loop through the contacts tag and outpout the values of
<role>Hello Chair</role><firstname>Test</firstname> <lastname>CC</lastname>
<?xml version="1.0" encoding="UTF-8"?>
<events reportname="Report Reviews ">
<eventname>test april 18</eventname>
<eventdate>Jan 18, 2014 - Jan 22, 2014</eventdate>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" />
<xsl:value-of select="eventname" />
<xsl:value-of select="eventdate" />
<xsl:value-of select="eventstatus" />