我在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