Jump to content

vishu16.vishwas@gmail.com

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About vishu16.vishwas@gmail.com

  • Rank
    Newbie
  1. Hi Anyone, It will be great if any one can help me to format my xslt in table format. I am given my below xslt and input xml also. Input xml: <?xml version="1.0" encoding="UTF-8"?> <L7j:jdbcQueryResult xmlns:L7j="http://ns.l7tech.com/2012/08/jdbc-query-result"> <L7j:row> <L7j:col name="name" type="java.lang.String">Policy for service #0b8bab6913cc588557b6973e94d1bfdd, WSTrustSoapService</L7j:col> <L7j:col name="comment" ><![CDATA[NULL]]></L7j:col><L7j:col name="version" type="java.lang.Integer">18</L7j:col></L7j:row> <L7j:row><L7j:col name="name" type="java.lang.String">Policy for service #0b8bab6913cc588557b6973e94d5893d, UUPRStub</L7j:col><L7j:col name="comment" ><![CDATA[NULL]]></L7j:col><L7j:col name="version" type="java.lang.Integer">16</L7j:col></L7j:row><L7j:row><L7j:col name="name" type="java.lang.String">Policy for service #0b8bab6913cc588557b6973e94d7900f, smstest</L7j:col><L7j:col name="comment" ><![CDATA[NULL]]></L7j:col><L7j:col name="version" type="java.lang.Integer">6</L7j:col></L7j:row> </L7j:jdbcQueryResult> XSLT Code: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:L7j="http://ns.l7tech.com/2012/08/jdbc-query-result"> <xsl:template match="/"> <html> <body> <h2>My CD Collection</h2> <table border="1"> <tr bgcolor="#9acd32"> <th>Name</th> <th>Comment</th> <th>Version</th> </tr> <xsl:for-each select="L7j:jdbcQueryResult/L7j:row/L7j:col"> <tr> <xsl:if test="@name ='name'"> <td><xsl:value-of select="."/></td> </xsl:if> <xsl:if test="@name ='comment'"> <td><xsl:value-of select="."/></td> </xsl:if> <xsl:if test="@name ='version'"> <td><xsl:value-of select="."/></td> </xsl:if> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> which give not correct format.. I want the format in below manner Name comment version ---------------------------------------- test test123 23
×
×
  • Create New...