Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to use string function in xsl while converting to jsp

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic