Click to See Complete Forum and Search --> : xslt and xml


CFHutton
06-22-2009, 11:32 AM
Hi all!

I have an xml file with a node that holds a comma separated list of function parameters. I need to feed those parameters into an onclick event call to a function.

I can't find anything that tells me how to construct a link that includes an onclick event and, further, how I can pass the parameter node data from my xml file into the function attached to the onclick event. I think I might have to use concat but I'm not sure...

Can anyone point me in the right direction?

Thanks,
CFH

jkmyoung
06-22-2009, 05:54 PM
How would you do the same in javascript? Guessing:
<div onclick="functionName('arg1value')">

You'd probably have something like
<div onclick="functionName({xpath/tonode/value})">

It's probably easier to parse the string in javascript then xslt.

CFHutton
06-24-2009, 09:22 AM
How would you do the same in javascript? Guessing:
<div onclick="functionName('arg1value')">

You'd probably have something like
<div onclick="functionName({xpath/tonode/value})">

It's probably easier to parse the string in javascript then xslt.

Thanks for the reply.

That's pretty much what I was trying to do, but being new to xslt I had a mistake because I didn't fully understand the use of attributes and the @ symbol.

Anyway, your post helped me narrow down the issue to a syntax error.

Thanks,
CFH