我在XML文件中的以下標籤:我怎麼能顯示工具提示表:XSL
<more_details>
<source>192.168.1.1</source>
<destination>10.10.10.10</destination>
<vlan>192.168.0.0/24</vlan>
<date>29/3/1391</date>
<count>24</count>
</more_details>
我想設計在使用XSL提示表;(我要當鼠標越過在頁面中一個特定的鏈接,它代表了數據表中的數據來自XML文件)
我寫了下面的線在我的XSL文件來實現這一目標的目標:
<a href="">
<xsl:attribute name="title"><table style='color:#efefef; background:none !important;'>
<tr>
<td><xsl:value-of select="source"/></xsl:value-of><td>
<td><xsl:value-of select="destination"/></xsl:value-of></td>
<td><xsl:value-of select="vlan"/></xsl:value-of></td>
<td><xsl:value-of select="date"/></xsl:value-of></td>
<td><xsl:value-of select="count"/></xsl:value-of></td>
</tr>
</table></xsl:attribute>
more details
</a>
它工作在一個html文件,但不在xsl文件中; XSL會自動刪除所有的html標籤。
這樣的:
<a href="" title="192.168.2.1125.45.24.5192.168.0.0/2429/2/1390 - 12:1424">
link
</a>
這意味着,當鼠標移到「更多細節」二字,工具提示中顯示的結果是:
192.168.2.1125.45.24.5192.168.0.0/2429/2/1390 - 12:1424
我想告訴每一個上面的標籤在表格的一列中。 (待結構化的) 但是當我運行該程序,它顯示在未結構化的格式數據(未在表中)
我還考試系統第二種方式:
<a href="">
<xsl:attribute name="title"><table style='color:#efefef; background:none !important;'>
<tr>
<td><xsl:value-of select="source"/></td>
<td><xsl:value-of select="destination"/></td>
<td><xsl:value-of select="vlan"/></td>
<td><xsl:value-of select="date"/></td>
<td><xsl:value-of select="count"/></td>
</tr>
</table></xsl:attribute>
more details
</a>
和它也不會工作。 這個第二種方式的結果是:
我真的需要你的幫助,任何答案都將非常感激。 thanx很多
在HTML'title'屬性中不能有表格。 HTML(也是XML)僅支持屬性值中的字符串。 – Tomalak 2012-08-14 11:42:04
嗯......但是當我把這個代碼放在HTML文件(不是xsl)中的的標題屬性中時,工具提示顯示了一個表格。 – user1597122 2012-08-14 11:49:25
什麼瀏覽器?你能爲此做一個jsFiddle嗎? – Tomalak 2012-08-14 12:00:18