[英]How can I pass html tags to xsl template?
我的XML文件內部具有html標記,其構建方式如下:
<pre>
<table border="">
<tbody>
<tr>
<th>Time</th>
<th>Result</th>
<th>Test</th>
<th>Method</th>
</tr>
<tr>
<td> 6:28:09 PM </td>
<td bgcolor="#FF0000"> FAIL </td>
<td width="30%"> TEST </td>
<td width="70%"> test_method </td>
</tr>
</tbody>
</table>
</pre>
這是帶有測試報告的表格。 我希望將此表傳遞給我的xsl模板,然后在生成的文件旁邊顯示它。
<xsl:value-of select="$suite/testsuite/tests/command/summaries/report/output" />
我在HTML中看到
<pre> <table border=""> <tbody> <tr> <th>Time</th> <th>Result</th> <th>Test</th> <th>Method</th> </tr> <tr> <td> 6:28:09 PM </td> <td bgcolor="#FF0000"> FAIL </td> <td width="30%"> TEST </td> <td width="70%"> test_method </td> </tr> </tbody> </table> </pre>
作為文本,不應用表格。 如何在新創建的html文件中顯示表格?
如果使用的XSLT處理器支持,則disable-output-escaping
可以幫助您: <xsl:value-of select="$suite/testsuite/tests/command/summaries/report/output" disable-output-escaping="yes"/>
。 請注意,像Firefox這樣的Mozilla瀏覽器不支持它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.