Hi! I having one XML file having a structure like this:
<?xml version="1.0" encoding="utf-8" ?><?xml-stylesheet type="text/xsl" href="temp.xslt" ?><Data><Row><DateAndTime>2015-07-03</DateAndTime><Count>406</Count><Count2>638</Count2></Row><Row><DateAndTime>2015-07-04/DateAndTime><Count>697</Count><Count2>697</Count2></Row></Data>
And for transform using xslt file (temp.xslt) with include javascript like this:
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" version="1.0" encoding="utf-8" indent="yes"/><xsl:template match="/"><html><head><script type="text/javascript"> function showTest() { var rowCount = <xsl:value-of select="count(Data/Row)" /> for(var i = 0; i < rowCount; i++) {<xsl:variable name="nValue">i</xsl:variable> var s1 = <xsl:value-of select="$nValue" /> var passcount = <xsl:value-of select="Data/Row[$nValue]/Count"/>; alert(passcount); } }</script></head><body><input type="button" value="view" onclick="showTest()" /></body></html></xsl:template></xsl:stylesheet>
How I can set index (ex. i in js loop) for <xsl:value-of select="Data/Row[INDEX]/Count"/>.
I tried to use <xsl:value-of select="Data/Row[i]/Count"/> but it's no work.
Any ideas?
Thanks!