PDA

View Full Version : CAN XSL with JAVASCRIPT


littlenam
07-14-2006, 09:37 AM
can i write the xsl file with javascript link this??

<script type="text/javascript">
function testclick()
{
document.write("<table border='0' cellpadding='0' cellspacing='2' width='597'>")
<xsl:for-each select="//*">
<xsl:if test="@dist='kln'">
document.write("<tr><td width='198'>")
<xsl:value-of select="cinema_name"/>
document.write("</td><td>")
<xsl:value-of select="address"/>
document.write("</td><td>")
<xsl:value-of select="tel"/>
document.write("</td></tr>")
</xsl:if>
</xsl:for-each>
document.write("</table>")
}
</script>

glenngv
07-14-2006, 07:57 PM
I don't think so. You can use XSL to output hidden fields and just access them from javascript.

macchisp
07-14-2006, 08:17 PM
How would you get javascript to work witih XSLT? I've tried embedding JS in XSLT and I cannot get it to work? I've also tried giving the <script> tag and href attribute and try to get it that way. Any ideas? Any good examples? Thanks.