Bookmark Topic Watch Topic
  • New Topic

how to use string function in xsl while converting to jsp

 
Kumar Anupam
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello,

I am using a xsl and jTidy to convert HTML into JSP. also puting my required tag & custom tags into it.

Now i need the value of a CLASS(css) attribute in any of the element in html will with replaced with the xml equalent xml statement.

where
<code>
//css is string value
css = css.substring(css.indexOf('|')+1);
</code>

I am defining my xsl as

<code>
<xsl:when test="@type='button'">
<!-- concat all command with "cmd_" e.g.command=next-> command=cmd_next-->
<xsl:text disable-output-escaping="yes">
<webform:commandButton
</xsl:text>

<xsl:for-each select="@*">
<xsl:if test="name(.)='command'"> <xsl:text> </xsl:text>
<xsl:text>command="</xsl:text>
<xsl:value-of select="concat('cmd_',.)"/>
<xsl:text>"</xsl:text>
</xsl:if>
<xsl:call-template name="checkAttribute">
<xsl:with-param name="attributeList"
select="'|id|css|value|onclick|title|value'"/>
<xsl:with-param name="input" select="name(.)"/>
<xsl:with-param name="value" select="."/>
</xsl:call-template>
</xsl:for-each>
<xsl:text disable-output-escaping="yes">/></xsl:text>
</xsl:when>
</code>


Please guide me. and respond me soon.

Thanks in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!