|
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Gasp! XML XSL transform with params!
Crimminy,Andre Turrettini 05/09/08 04:45 P >Crimminy,Dominic Watson 05/09/08 06:04 P > http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000673.htmDominic Watson 05/09/08 06:10 P Sighh. Thanks Dominic. That was hours of wasted time.Andre Turrettini 05/12/08 12:39 P > Tho it makes sense. xslt is case sensitive and passing a dot notation structure thru coldfusion upercases it. My xslt was looking for lowercase but getting passed > > uppercase named variables.Dominic Watson 05/12/08 06:14 P One of the many reasons why case sensitivity is one the dumbest things everEric Roberts 05/12/08 09:00 P > One of the many reasons why case sensitivity is one theDave Watts 05/12/08 10:57 P Crimminy, Why am I having trouble passing parameters in xmltransform? <cfsavecontent variable="x"><?xml version="1.0" encoding="UTF-8"?> <article></article> </cfsavecontent> <cfsavecontent variable="l"> <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:param name="mpath" /> <xsl:template match="/"> <xsl:value-of select="concat('happy ', $mpath, ' to you')" /> </xsl:template> </xsl:transform> </cfsavecontent> <cfset tmp = structnew()> <cfset tmp.mpath = 'birthday'> <cfoutput>#xmltransform(x, l, tmp)#</cfoutput> >Crimminy, > Why am I having trouble passing parameters in xmltransform? You're not going mad; check out the first comment in the livedocs: http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000673.htm On further experimentation, you don't need to go that far. Instead, use array notation for your struct keys and all will be well: ... <cfset tmp = StructNew()> <cfset tmp['mpath'] = 'birthday'> ... Dominic -- Blog it up: http://fusion.dominicwatson.co.uk > http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000673.htm I've now read all the comments (I'm far too impatient) and comment four assesses the problem brilliantly; the comment by Ethan Cane (ethan@xmlstandards.org). Dominic -- Blog it up: http://fusion.dominicwatson.co.uk Sighh. Thanks Dominic. That was hours of wasted time. Tho it makes sense. xslt is case sensitive and passing a dot notation structure thru coldfusion upercases it. My xslt was looking for lowercase but getting passed uppercase named variables. Criminy. Andre ----- Excess quoted text cut - see Original Post for more ----- > Tho it makes sense. xslt is case sensitive and passing a dot notation structure thru coldfusion upercases it. My xslt was looking for lowercase but getting passed > > uppercase named variables. Ah yes, that makes a whole heap of sense; good to know why it fails - what a pita that is! Dominic -- Blog it up: http://fusion.dominicwatson.co.uk One of the many reasons why case sensitivity is one the dumbest things ever devised in the computer world. If it made sense at one time (and that is a big if...I have yet to hear a logical argument for it) it certainly doesn't make sense now. Eric /*-----Original Message----- /* /*Sent: Monday, May 12, 2008 5:13 PM /*To: CF-Talk /*Subject: Re: Gasp! XML XSL transform with params! /* /*> Tho it makes sense. xslt is case sensitive and passing a dot notation /*structure thru coldfusion upercases it. My xslt was looking for lowercase /*but getting passed > > uppercase named variables. /* /*Ah yes, that makes a whole heap of sense; good to know why it fails - /*what a pita that is! /* /*Dominic /* /*-- /*Blog it up: http://fusion.dominicwatson.co.uk /* /* > One of the many reasons why case sensitivity is one the > dumbest things ever devised in the computer world. If it > made sense at one time (and that is a big if...I have yet to > hear a logical argument for it) it certainly doesn't make > sense now. Case sensitivity requires the computer to do less work. In the case of XML specifically, XML parsers are found in a wide range of environments, from desktops and servers to cellphones and embedded devices, some of which have extremely limited resources and capabilities. And, they all have to work the same way. In compiled languages, I find case sensitivity to be a helpful guide in understanding how a program works. For example, in Actionscript 3, all class names are in "title case", so it's easy to identify what's a class in your code. Coding conventions can help solve this problem, but rules/constraints/restrictions work better. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Training: Adobe/Google/Paperthin Certified Partners http://training.figleaf.com/ WebManiacs 2008: the ultimate conference for CF/Flex/AIR developers! http://www.webmaniacsconference.com/
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||