i create xml includes html tags see below. try convert xml data html according xslt. but, can't handle html tags included in xml. need whatever in summary tag written (without losing html tags). should ?
<checklist name="00.07-parts"> <summary> <table border="1" cellpadding="7" cellspacing="0" style="width:100%"> <tbody> <tr> <td> <p><strong> aaaaaaa </strong></p> </td> <td> <p><strong> bbbbbbbb </strong></p> </td> </tr> </tbody> </table> </summary> </checklist>
here, xslt part
<xsl:for-each select="checklist"> <table class="tbchecklist"> <tbody> <tr> <td> <h4> <xsl:value-of select="@name"/> </h4> </td> </tr> <tr> <td> <xsl:value-of select="summary"/> </td> </tr> </tbody> </table> </xsl:for-each>
here result
<table class="tbchecklist"> <tbody> <tr> <td> <h4>00.07-parts</h4> </td> </tr> <tr> <td> aaaaaaa bbbbbbbb <td> <tr> </tbody> </table>
you can use copy-of instead of value-of. copy-of gives whole content of selected node, including other nodes.
<xsl:copy-of select="summary"/>
Comments
Post a Comment