Hi Josh

>> The following code opens and outputs an XML file based on an XSL template
>> using ASP .... I was wondering if there are similar functions in CF or if
>> someone could point me in the right direction towards functions or whatnot
>> ......

>> <%
>> 'Load the XML
>> set xml = Server.CreateObject("Microsoft.XMLDOM")
>> xml.async = false
>> xml.load(Server.MapPath("myfile.xml"))
>> 
>> 'Load the XSL
>> set xsl = Server.CreateObject("Microsoft.XMLDOM")
>> xsl.async = false
>> xsl.load(Server.MapPath("myfile.xsl"))
>> 
>> Response.Write(xml.transformNode(xsl))
>> %>

Here's the code you need:

<cfobject action="create" class="MSXML2.DOMDocument" name="xml">
<cfobject action="create" class="MSXML2.DOMDocument" name="xsl">

<cffile action="read" file="d:\xml\myxmlfile.xml" variable="xmlfile">
<cffile action="read" file="d:\xml\myxslfile.xml" variable="xslfile">

<cfscript>
xml.load(xmlfile);
xsl.load(xslfile);
transformed = xml.transformNode(xsl);
writeoutput(transformed);
</cfscript>

You might also be interested in my new CF/XML mailing list - I've also
written a few XML custom tags which I'll be publishing through the list:

http://torchbox.com/xml

Best wishes

Tom

-----------------+
tom dyson
t: +44 (0)1608 811870
m: +44 (0)7958 752657
[EMAIL PROTECTED]
http://torchbox.com


Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to