XSLT Stylesheet works with a vbs script, but not Perl
Posted
by
user2472274
on Stack Overflow
See other posts from Stack Overflow
or by user2472274
Published on 2013-06-24T19:16:23Z
Indexed on
2013/06/24
22:22 UTC
Read the original article
Hit count: 317
I have a program that is essentially a search application, and it exists in both VBScript and Perl form (I'm trying to make an executable with a GUI).
Currently the search application outputs an HTML file, and if a section of text in the HTML is longer than twelve lines then it hides anything after that and includes a clickable More...
tag.
This is done in XSLT and works with VBScript.
I literally copied and pasted the stylesheet into the Perl program that I'm using and it does everything right except for the More...
tag.
Is there any reason why it would be working with the VBScript but not Perl?
I'm using XML::LibXSLT
in the Perl script, and here is the template that is supposed to be creating the More...
tag
<xsl:template name="more">
<xsl:param name="text"/>
<xsl:param name="row-id"/>
<xsl:param name="cycle" select="1"/>
<xsl:choose>
<xsl:when test="($cycle > 12) and contains($text,' ')">
<span class="show" onclick="showID('SHOW{$row-id}');style.display = 'none';">More...</span>
<span class="hidden" id="SHOW{$row-id}">
<xsl:call-template name="highlight">
<xsl:with-param name="text" select="$text"/>
</xsl:call-template>
</span>
</xsl:when>
<xsl:when test="contains($text,' ')">
<xsl:call-template name="highlight">
<xsl:with-param name="text" select="substring-before($text,' ')"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:call-template name="more">
<xsl:with-param name="text" select="substring-after($text,' ')"/>
<xsl:with-param name="row-id" select="$row-id"/>
<xsl:with-param name="cycle" select="$cycle + 1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="highlight">
<xsl:with-param name="text" select="$text"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
© Stack Overflow or respective owner