[thelist] Generating html links with XSLT

Dave Merrill dmerrill at usa.net
Wed Dec 28 16:43:19 CST 2005


Hmmmm. If you're suggesting the &quote; version, except w actual "s in place
of &quote;, that doesn't work. This:
-----------------
<xsl:value-of select="concat('presetRecall("', @name, '")')"/>
-----------------

...generates this error in Cooktop:
-----------------
ERROR: Required white space was missing.

Source: ' <xsl:value-of select="concat('presetRecall("', @name, '")')"/>'
Line: 18, Pos: 56
-----------------

My guess is that that's the result of confusion around the gaggle of mixed
single- and double-quotes near the end. Any variants that might work?


However, this strategy works, within limits:
Earlier in the sheet, create a "constant" like this:
-----------------
<xsl:variable name="kQuote">'</xsl:variable>
-----------------

Then use it for the quotes:
-----------------
<xsl:value-of select="concat('presetRecall(', $kQuote, @name, $kQuote,
')')"/>
-----------------

The limitation is that depending on the values expected in @name, you may
want the enclosing quotes to be "s, and that doesn't work, either as a
literal or as &#34;. No errors, but they end up as &quote; in the html.

So I'm almost there, maybe functionally done. I'd still like to know how to
get a double quote in there. Any ideas?

Thanks again,

Dave Merrill


> Well you're almost done
>
> <a href="#">
> <xsl:attribute name="onclick">
> <xsl:value-of select="concat('presetRecall(&quot;', 'fooo', '&quot;)')"/>
> </xsl:attribute>
> <xsl:text>Recall</xsl:text>
> </a>
>
> will resolve to:
>
> <a href="#" onclick="presetRecall(&quot;fooo&quot;)">Recall</a>
>
> Don't bother with the &quot; entity : it will act identical to a
> double quote (") which it actaully is :)
>
> Here is a test script I used to prove it.
>
> -------------
> <script>
> function dongi(argument){
> 	if(argument=='fooo')alert('foooo');
>
> }
> </script>
>
> <a href="#" onclick="dongi(&quot;fooo&quot;)">Recall</a>
> -----------------
>
> Script works without error on ie/moz/opera.
>
> Cheers,
> --
> Volkan Ozcelik
> +>Yep! I'm blogging! : http://www.volkanozcelik.com/volkanozcelik/blog/
> +> My projects/studies/trials/errors : http://www.sarmal.com/
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>
>





More information about the thelist mailing list