Subject: Re: [xsl] JavaScript and XSL Problems From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Date: Fri, 19 Jul 2002 10:10:59 +0100 |
Hi Puneet, >> XSL Code Fragment: >> >> <xsl:template match="//sectiontitle" mode="toc"> >> <script type="text/javascript"> >> collectData(<xsl:value-of select="count(//sectiontitle)+count(//title)+count(//subtitle)"/>, l, <xsl:value-of select="normalize-space(.)"/>); >> l++; >> <xsl:for-each select="..//title"> >> collectData(<xsl:value-of select="count(//sectiontitle)+count(//title)+count(//subtitle)"/>, l, <xsl:value-of select="normalize-space(.)"/>); >> l++; >> <xsl:for-each select="..//subtitle"> >> collectData(<xsl:value-of select="count(//sectiontitle)+count(//title)+count(//subtitle)"/>, l, <xsl:value-of select="normalize-space(.)"/>); >> l++; >> </xsl:for-each> >> </xsl:for-each> >> </script> >> </xsl:template> If you look at the JavaScript generated by this code, you'll see something along the lines of: <script type="text/javascript"> collectData(12, l, a lot of text...); l++; collectData(12, l, some more text...); l++ collectData(12, l, yet more text...); l++; ... </script> I suspect that the problem is that the third argument to your collectData function, as you're generating it, hasn't got any quotes around it. If you change those lines that generate the "collectData(...)" call to: collectData( <xsl:value-of select="count(//sectiontitle)+count(//title)+count(//subtitle)"/>, l, "<xsl:value-of select="normalize-space(.)"/>"); So that double quotes are generated around the last argument, you might have better luck. By the way, are you sure that you want the first argument to be the same for each call to the collectData() function? Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] JavaScript and XSL Problems, Railan, Puneet Mr., | Thread | Re: [xsl] JavaScript and XSL Proble, Jeni Tennison |
RE: [xsl] in XSL other than , Julian Reschke | Date | Re: [xsl] javascript problem, Jeni Tennison |
Month |