[thelist] Javascript in XSLT

Joel Konkle-Parker jjk3 at msstate.edu
Sun Jun 23 18:10:01 CDT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've got the following event handlers in my XSLT-to-html stylesheet:

onmouseover="showSubMenu('menuGamesDrop')"
onmouseout="hideSubMenu('menuGamesDrop')"

The Games section, however, gets generated on the fly from another
file, so I actually have the following:

onmouseover="{concat('showMenu('menu', category_name,
'Drop')')}"
onmouseout="{concat('hideMenu('menu', category_name,
'Drop')')}"

Where (if they show up) ', (, and ) are all escaped when they're
needed in the event handlers. When I try this though, I get errors in
Saxon and IE javascript errors. The exact Saxon message is:

Error at div on line 34 of
http://www.ballsome.com/test/stylesheets/home.xsl:
  Error in expression concat('showMenu('menu', category_name,
'Drop')'): expecte
d ")", found "<name>"

Looks like it's replacing the entity references before it processes
the XSLT, so the single quotes are messing the concat function up. Is
there any way to fix this? Will it accept alternating single and
double quotes or something like that?

- -joeljkp

- ---------------------------------------
http://www.ballsome.com

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPRZVHn880CLOJa2eEQKzQQCgn3sUg+H8JX2lhWxkPqSVEleQTwoAnjjZ
nehcpOiOAixH8/oOodsCfUTi
=Bl+H
-----END PGP SIGNATURE-----





More information about the thelist mailing list