<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc = "http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://livedocs.adobe.com/">
	<title>LiveDocs Comments - coldfusion - 7 - htmldocs - 00000673.htm</title>	
		<link>http://livedocs.adobe.com/</link>
		<description>Macromedia LiveDocs - online documentation with user feedback.</description>
		<copyright>Copyright 2009, Macromedia, Inc.</copyright>
		<dc:date>2009-11-25T22:25:43</dc:date>
		<dc:language>en-us</dc:language>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#83933" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#68002" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#45505" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#42281" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#39996" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#38182" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#31620" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#31306" />
			</rdf:Seq>
		</items>
	</channel>
	
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#83933">
		<title>coldfusion/7/htmldocs/00000673.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#83933</link>
		<description>The dot notation is actually acceptable keeping in mind that .notation creates structures that have upper case keys.  So, your xslt (which is case sensitive) must be looking for variables that are all upercase with xsl:param. &lt;br /&gt;&lt;br /&gt;Coldfusion structures created with array notation keep the case in the key so work as expected.</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-05-12T09:44:12</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#68002">
		<title>coldfusion/7/htmldocs/00000673.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#68002</link>
		<description>XmlTransform() will NOT work with if you call cfFile() and your stylesheet imports any supporting stylesheets.  It will find your top-level stylesheet but not the imports, and you will get an IO exception (&quot;Had IO Exception with stylesheet file&quot;).  Mark Mandel has created a UDF that solves the problem, and you can find it here:&lt;br /&gt;http://www.compoundtheory.com/?action=displayPost&amp;ID=4.  &lt;br /&gt;&lt;br /&gt;J-P Stacey then extended Mark's work  to create a more granular component that includes caching.  You can find that here:&lt;br /&gt;http://www.jpstacey.info/blog/2007/02/09/cfjavaxml-a-component-for-cached-xml-transformations/&lt;br /&gt;&lt;br /&gt;Kudos to these gentlemen for fixing a problem and sharing the solution.  Your work is much appreciated.</description>
		<dc:creator>madDog17</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-06-06T10:20:09</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#45505">
		<title>coldfusion/7/htmldocs/00000673.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#45505</link>
		<description>The XML and the XSL do not relate to each other, thus breaking the example.  The XML doc is referencing the purchase of tools, while the XML is expecting &quot;breakfast_menu/food&quot;.  The result of the example is an empty, yellow table.</description>
		<dc:creator>swood</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2006-02-23T19:20:54</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#42281">
		<title>coldfusion/7/htmldocs/00000673.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#42281</link>
		<description>The W3C link for XSL and XSLT mistakenly points to XPath (www.w3.org/TR/xpath/).</description>
		<dc:creator>Sarge</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2005-11-14T08:19:41</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#39996">
		<title>coldfusion/7/htmldocs/00000673.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#39996</link>
		<description>&lt;!---&lt;br /&gt;Author:&lt;br /&gt;Ethan Cane (ethan@xmlstandards.org)&lt;br /&gt;&lt;br /&gt;Description:&lt;br /&gt;ColdFusion MX (Blackstone) provides the ability to transform an XML document &lt;br /&gt;using an XSLT stylesheet using the XmlTransform() function as shown below:&lt;br /&gt;&lt;br /&gt;&lt;cfoutput&gt;#XmlTransform(xml, xsl[, parameters])#&lt;/cfoutput&gt;&lt;br /&gt;&lt;br /&gt;The first two arguments of this function are both required leaving an optional &lt;br /&gt;[parameters] argument, which according to Macromedia ought to be a structure &lt;br /&gt;of named value pairs used by your XSLT stylesheet.&lt;br /&gt;&lt;br /&gt;Unfortunately there appears to be some confusion in how structures need to be &lt;br /&gt;constructed in order for this argument to work correctly. It would appear that &lt;br /&gt;your structure needs to use the following two build methods:&lt;br /&gt;&lt;br /&gt;1.) Associative array notation: &lt;cfset parameters[&quot;param-name&quot;] = &quot;param-value&quot;/&gt;&lt;br /&gt;&lt;br /&gt;2.) Function notation: &lt;cfset StructInsert(parameters, &quot;param-name&quot;, &quot;param-value&quot;)/&gt;&lt;br /&gt;&lt;br /&gt;Using the &quot;Object notation&quot; simply does not work even though it does &lt;br /&gt;create a valid structure object; &lt;cfset parameters.param-name = &quot;param-value&quot;/&gt;.&lt;br /&gt;&lt;br /&gt;I presume the reason for this might be the potential use (as shown) of the hyphen &lt;br /&gt;character (param-name) which ColdFusion would interpret as a mathematical operation.&lt;br /&gt;&lt;br /&gt;Coded below is a brief working example of how to successfully pass parameters to an &lt;br /&gt;XSLT stylesheet via ColdFusion MX (Blackstone).&lt;br /&gt;&lt;br /&gt;For the purposes of compactness both the target XML document and the XSLT stylesheet &lt;br /&gt;are both coded on this template. The result is simply output as XHTML to the browser.&lt;br /&gt;---&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--- Let's define a CFML based XML document object to store a simple XML instance ---&gt;&lt;br /&gt;&lt;cfxml variable=&quot;variables.theXmlDoc&quot;&gt;&lt;br /&gt;	&lt;!--- Remember not to include an XML declaration here, otherwise an error will be thrown ---&gt;&lt;br /&gt;	&lt;greeting&gt;&lt;br /&gt;		&lt;string&gt;Using XmlTransform() with parameters&lt;/string&gt;&lt;br /&gt;	&lt;/greeting&gt;&lt;br /&gt;&lt;/cfxml&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--- Let's create a CFML based XML document object to store a simple XSLT stylesheet ---&gt;&lt;br /&gt;&lt;cfxml variable=&quot;variables.theXslDoc&quot;&gt;&lt;br /&gt;	&lt;!--- Remember not to include an XML declaration here, otherwise an error will be thrown. ---&gt;&lt;br /&gt;	&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot; version=&quot;1.0&quot;&gt;&lt;br /&gt;		&lt;!--- Define result tree output parameters ---&gt;&lt;br /&gt;		&lt;xsl:output method=&quot;xml&quot; indent=&quot;yes&quot; doctype-public=&quot;-//W3C//DTD XHTML 1.1//EN&quot; doctype-system=&quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;/&gt;&lt;br /&gt;		&lt;br /&gt;		&lt;!--- Let's create a single parameter with a default value for output later ---&gt;&lt;br /&gt;		&lt;xsl:param name=&quot;cartoon-character&quot;&gt;&lt;br /&gt;			&lt;xsl:text&gt;Butters Stotch&lt;/xsl:text&gt;&lt;br /&gt;		&lt;/xsl:param&gt;&lt;br /&gt;		&lt;br /&gt;		&lt;!--- Let's build the XHTML skeleton as literal result elements ---&gt;&lt;br /&gt;		&lt;xsl:template match=&quot;/&quot;&gt;&lt;br /&gt;			&lt;html xml:lang=&quot;en&quot;&gt;&lt;br /&gt;				&lt;head&gt;&lt;br /&gt;					&lt;title&gt;&lt;xsl:value-of select=&quot;greeting/string&quot;/&gt;&lt;/title&gt;&lt;br /&gt;				&lt;/head&gt;&lt;br /&gt;				&lt;body&gt;&lt;br /&gt;					&lt;h1&gt;&lt;xsl:value-of select=&quot;greeting/string&quot;/&gt;&lt;/h1&gt;&lt;br /&gt;					&lt;!--- Continue stylesheet processing ---&gt;&lt;br /&gt;					&lt;xsl:apply-templates select=&quot;greeting&quot;/&gt;&lt;br /&gt;				&lt;/body&gt;&lt;br /&gt;			&lt;/html&gt;&lt;br /&gt;		&lt;/xsl:template&gt;&lt;br /&gt;		&lt;br /&gt;		&lt;!--- Let's output the values of the previously defined parameters ---&gt;&lt;br /&gt;		&lt;xsl:template match=&quot;greeting&quot;&gt;&lt;br /&gt;			&lt;p&gt;&lt;xsl:value-of select=&quot;$cartoon-character&quot;/&gt;&lt;/p&gt;&lt;br /&gt;		&lt;/xsl:template&gt;&lt;br /&gt;	&lt;/xsl:stylesheet&gt;&lt;br /&gt;&lt;/cfxml&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--- Let's now define the parameter we'd like to pass to the XSLT stylesheet. ---&gt;&lt;br /&gt;&lt;cfscript&gt;&lt;br /&gt;	variables.theXslParams = StructNew();&lt;br /&gt;	StructInsert(variables.theXslParams, &quot;cartoon-character&quot;, &quot;Stan Marsh&quot;);&lt;br /&gt;	WriteOutput(XmlTransform(variables.theXmlDoc, variables.theXslDoc, variables.theXslParams));&lt;br /&gt;&lt;/cfscript&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--- Alternatively you could also using the following syntax for building your structure ---&gt;&lt;br /&gt;&lt;cfscript&gt;&lt;br /&gt;	variables.theXslParams = StructNew();&lt;br /&gt;	variables.theXslParams[&quot;cartoon-character&quot;] = &quot;Kyle Broflovski&quot;;&lt;br /&gt;	WriteOutput(XmlTransform(variables.theXmlDoc, variables.theXslDoc, variables.theXslParams));&lt;br /&gt;&lt;/cfscript&gt;&lt;br /&gt;&lt;br /&gt;&lt;!---&lt;br /&gt;But remember that using &quot;Object notation&quot; to create your stucture will not work. &lt;br /&gt;If your parameter name happens to contain a hyphen for separating words (param-name) &lt;br /&gt;ColdFusion will throw an error. In any other event the default values defined within the XSLT &lt;br /&gt;stylesheet would be used since this method doesn't even pass in parameters to begin with.&lt;br /&gt;---&gt;&lt;br /&gt;&lt;!---&lt;br /&gt;// Uncomment this statement block if you like seeing ColdFusion MX exceptions being thrown.&lt;br /&gt;&lt;cfscript&gt;&lt;br /&gt;	variables.theXslParams = StructNew();&lt;br /&gt;	variables.theXslParams.cartoon-character = &quot;Kenny McCormick&quot;;&lt;br /&gt;	WriteOutput(XmlTransform(variables.theXmlDoc, variables.theXslDoc, variables.theXslParams));&lt;br /&gt;&lt;/cfscript&gt;&lt;br /&gt;---&gt;</description>
		<dc:creator>www.xmlstandards.org</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2005-09-26T20:06:20</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#38182">
		<title>coldfusion/7/htmldocs/00000673.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#38182</link>
		<description>I keep forgetting... you can only add structure elements via the StructInsert() function. The JavaScript shorthand (of simply adding the structure name after a dot) is not valid.</description>
		<dc:creator>tedmasterweb</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2005-08-01T09:05:36</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#31620">
		<title>coldfusion/7/htmldocs/00000673.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#31620</link>
		<description>There seems to be problems with the example code included:&lt;br /&gt;&lt;br /&gt;The xsl filename should be custorder.xsl (versus custorder.xsd), and the text of the document does not match the provided custorder.xml file.&lt;br /&gt;&lt;br /&gt;After corrections the custorder.xsl file should read:&lt;br /&gt;&lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;&lt;br /&gt;&lt;xsl:output method=&quot;html&quot; doctype-public=&quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot; /&gt;&lt;br /&gt;   &lt;xsl:template match=&quot;/&quot;&gt;&lt;br /&gt;      &lt;html&gt;&lt;br /&gt;         &lt;body&gt;&lt;br /&gt;            &lt;table border=&quot;2&quot; bgcolor=&quot;yellow&quot;&gt;&lt;br /&gt;               &lt;tr&gt;&lt;br /&gt;                  &lt;th&gt;Name&lt;/th&gt;&lt;br /&gt;                  &lt;th&gt;Price&lt;/th&gt;&lt;br /&gt;               &lt;/tr&gt;&lt;br /&gt;               &lt;xsl:for-each select=&quot;order/items/item&quot;&gt;&lt;br /&gt;                  &lt;tr&gt;&lt;br /&gt;                     &lt;td&gt;&lt;br /&gt;                        &lt;xsl:value-of select=&quot;name&quot;/&gt;&lt;br /&gt;                     &lt;/td&gt;&lt;br /&gt;                     &lt;td&gt;&lt;br /&gt;                        &lt;xsl:value-of select=&quot;unitprice&quot;/&gt;&lt;br /&gt;                     &lt;/td&gt;&lt;br /&gt;                  &lt;/tr&gt;&lt;br /&gt;               &lt;/xsl:for-each&gt;&lt;br /&gt;            &lt;/table&gt;&lt;br /&gt;         &lt;/body&gt;&lt;br /&gt;      &lt;/html&gt;&lt;br /&gt;   &lt;/xsl:template&gt;&lt;br /&gt;&lt;/xsl:stylesheet&gt;</description>
		<dc:creator>TimD224</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2005-04-15T11:32:15</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#31306">
		<title>coldfusion/7/htmldocs/00000673.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000673.htm#31306</link>
		<description>einfo, i also tried passing a structure for the parameter option, to no avail. I en ded up using a HashMap instead:&lt;br /&gt;&lt;br /&gt;params = createObject(&quot;java&quot;, &quot;java.util.HashMap&quot;).init();&lt;br /&gt;params.put(&quot;paramName&quot;, paramValue);&lt;br /&gt;xmlTransform(xml, xsl, params);</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2005-04-12T06:22:29</dc:date>
	</item>
	</rdf:RDF>

