• Post Reply 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

learn xsl to html creation

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is a excellent code to under xsl to html transformation

:: all code is self expalnatory

<?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" indent = "yes"/>
<xsl:template match="/">
<html>
<head>
</head>
<body>
<h1><I><xsl:value-of select= "content/entity/@name"/></I></h1>
<hr/>
<font color='#888888'>
<xsl:value-of select= "content/entity/country"/>
>
<xsl:value-of select= "content/entity/sector"/>
</font>
<br/>
<br/>
<xsl:for-each select="content/ratingCategory">
<xsl:if test = "@ratingTypeCode = 'ICR'">
<xsl:if test = "rating/name= 'Final'">
<xsl:choose>
<xsl:when test = "not(rating/creditWatch = 'Y')">
<b><font color='blue'><center><xsl:value-of select = "rating/outlook"/> / <xsl:value-of select = "rating/ratingCode"/></center></font></b>
</xsl:when>
<xsl:when test = "rating/creditWatch = 'Y'">
<center>CW:<xsl:value-of select = "rating/outlook"/> / <xsl:value-of select = "rating/ratingCode"/></center>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:if>
</xsl:for-each>
<br/>
<p><xsl:value-of select= "content/comments"/></p>
<br></br>
<b><table border="1" align='center'>
<tr><th></th><th><b><font color='#009900'>Existing</font></b></th><th><b><font color='#009900'>Recommended</font></b></th><th><b><font color='#009900'>Final</font></b> </th></tr>
<xsl:for-each select="content/ratingCategory">
<tr>
<td><b><font color='#A80000'><xsl:value-of select = "@ratingTypeName"/></font></b></td>
<td align='center'>
<xsl:if test = "rating/name = 'Existing'">
<xsl:choose>
<xsl:when test = "not(rating/creditWatch = 'Y')">
<xsl:value-of select = "rating/outlook"/> / <xsl:value-of select = "rating/ratingCode"/>
</xsl:when>
<xsl:when test = "rating/creditWatch = 'Y'">
CW:<xsl:value-of select = "rating/outlook"/> / <xsl:value-of select = "rating/ratingCode"/>
</xsl:when>
</xsl:choose>
</xsl:if>
</td>
<td align='center'>
<xsl:if test = "rating/name = 'Recommended'">
<xsl:choose>
<xsl:when test = "not(rating/creditWatch = 'Y')">
<xsl:value-of select = "rating/outlook"/> / <xsl:value-of select = "rating/ratingCode"/>
</xsl:when>
<xsl:when test = "rating/creditWatch = 'Y'">
CW:<xsl:value-of select = "rating/outlook"/> / <xsl:value-of select = "rating/ratingCode"/>
</xsl:when>
</xsl:choose>
</xsl:if>
</td>
<td align='center'>
<xsl:if test = "rating/name = 'Final'">
<xsl:choose>
<xsl:when test = "not(rating/creditWatch = 'Y')">
<xsl:value-of select = "rating/outlook"/> / <xsl:value-of select = "rating/ratingCode"/>
</xsl:when>
<xsl:when test = "rating/creditWatch = 'Y'">
CW:<xsl:value-of select = "rating/outlook"/> / <xsl:value-of select = "rating/ratingCode"/>
</xsl:when>
</xsl:choose>
</xsl:if>
</td>
</tr>
</xsl:for-each>
</table>
</b>
<br/>
<br/>
<b>
<P align="left">Recommended By:
<br></br>
<br/>
Chairman :
<xsl:for-each select="content/entity/committeeMember/memberInfo">
<xsl:if test = "role = 'chairman'">
<xsl:value-of select = "@name"/>
</xsl:if>
</xsl:for-each>
<br/>
Voters :
<xsl:for-each select="content/entity/committeeMember/memberInfo">
<xsl:if test = "role = 'voter'">
<xsl:value-of select = "@name"/>;
</xsl:if>
</xsl:for-each>
</P>
</b>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
reply
    Bookmark Topic Watch Topic
  • New Topic