House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Search cf-talk

July 03, 2009

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Home /  Groups /  ColdFusion Talk (CF-Talk)

Gasp! XML XSL transform with params!

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andre Turrettini
05/09/2008 04:45 PM

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>

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dominic Watson
05/09/2008 06:04 PM

>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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dominic Watson
05/09/2008 06:10 PM

> 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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andre Turrettini
05/12/2008 12:39 PM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dominic Watson
05/12/2008 06:14 PM

> 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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Eric Roberts
05/12/2008 09:00 PM

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 /* /*

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
05/12/2008 10:57 PM

> 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/


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists