Subject:Insert javascript calls in XSL output at client side?? is this possible? if yes how???? Author:Anne Wreh Date:11 Apr 2006 06:15 AM
Hi all.
I'm a bit frustrated right now :-(
I've been playing around with client-side XSL transformations with Ajax and I'm facing that problem mentioned in the topic. All the processing is made in the client-side.
What I want to do is the following:
- I'm receiving xml data from an HTTP request from a server.
- This xml data needs to be parsed with xsl and displayed in the browsers using a data grid control.
- To display the data of each row I have to make javsacript calls like: gridView.addDataRow ( "[ID]", new Array ( [DATA ] )
I have tried inserting the tag ( with and without the xsl:text ):
[CODE]
<script>
<xsl:text>gridView.addRowData("</xsl:text><xsl:value-of select="../@unid"/><xsl:text>", new Array ( "</xsl:text><xsl:apply-templates/><xsl:text>");</xsl:text>
</script>
[CODE]
inside the xsl for each element to display but I get an error,
I have tried also the following code ( with and without the xsl:text ):
[CODE]
<lxslt:script lang="javascript">
<xsl:text>gridView.addRowData("</xsl:text><xsl:value-of select="../@unid"/><xsl:text>", new Array ( "</xsl:text><xsl:apply-templates/><xsl:text>");</xsl:text>
</lxslt:script>
[CODE]
but also without any luck!! :( .
I'm now completely lost and I don't know what to do, anyone could help me a bit with that??
Thanks guys!!
PD: gridView is a JS object defined previously in the document.