Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xslt 如何在工具提示中显示表:XSL_Xslt_Tooltip_Jquery Tooltip - Fatal编程技术网

Xslt 如何在工具提示中显示表:XSL

Xslt 如何在工具提示中显示表:XSL,xslt,tooltip,jquery-tooltip,Xslt,Tooltip,Jquery Tooltip,我在xml文件中有以下标记: <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&g

我在xml文件中有以下标记:

<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>
我想在表的一列中显示上面的每个标记。(待组织) 但当我运行程序时,它显示的数据不是结构化格式(不在表中)

我还考察了第二种方法:

<a href="">
  <xsl:attribute name="title">&lt;table style='color:#efefef; background:none !important;'>
    <tr>
      <td><xsl:value-of select="source"/>&lt;/td>
      <td><xsl:value-of select="destination"/>&lt;/td>
      <td><xsl:value-of select="vlan"/>&lt;/td>
      <td><xsl:value-of select="date"/>&lt;/td>
      <td><xsl:value-of select="count"/>&lt;/td>
    </tr>
  </table></xsl:attribute>
    more details
</a>

而且它也不起作用。 第二种方法的结果是:


我真的需要你的帮助,任何回答都将不胜感激。thanx很多

在HTML
标题
属性中不能有表。这是不可能的,停止尝试

您可以做什么:

  • 使用可用的JavaScript库之一生成自定义工具提示。例如,jQuery有用于此的插件,但还有许多其他插件。这些库可以在鼠标上显示任何类型的HTML,所以表不会成为问题
  • 只需在属性中添加换行符。大多数浏览器支持
    标题
    属性中的换行符,并将其显示在屏幕上。虽然没有桌子那么漂亮,但可能已经足够了
  • 我将仅详细介绍第二个选项。第一个问题超出了这个问题的范围

    <a href="">
      <xsl:attribute name="title">
         <xsl:value-of select="concat('Source: ', source, '&#10;')" />
         <xsl:value-of select="concat('Destination: ', destination, '&#10;')" />
         <xsl:value-of select="concat('VLAN: ', source, '&#10;')" />
         <xsl:value-of select="concat('Date: ', date, '&#10;')" />
         <xsl:value-of select="concat('Count: ', count)" />
      </xsl:attribute>
      <xsl:text>more details</xsl:text>
    </a>
    
    
    
    HTML
    标题属性中不能有表。HTML(以及XML)仅支持属性值中的字符串。hmmm。。。但是,当我把这段代码放在html文件(而不是xsl)的title属性中时,工具提示会显示一个表。什么浏览器?你能为此制作一个JSFIDLE吗?谢谢你,亲爱的Tomalak。现在它有了一个更好的结构(每个标记都在单独的行中)结果是:Source:Destination:VLAN:Date:Count:问题是它没有显示标记的值。我有一个问题:为什么下面的行在xsl中不起作用?:它没有显示的值!!这意味着在的title属性中不允许使用xsl或html标记?那么解决方案是什么呢?
    
    192.168.2.1125.45.24.5192.168.0.0/2429/2/1390 - 12:1424
    
    <a href="">
      <xsl:attribute name="title">&lt;table style='color:#efefef; background:none !important;'>
        <tr>
          <td><xsl:value-of select="source"/>&lt;/td>
          <td><xsl:value-of select="destination"/>&lt;/td>
          <td><xsl:value-of select="vlan"/>&lt;/td>
          <td><xsl:value-of select="date"/>&lt;/td>
          <td><xsl:value-of select="count"/>&lt;/td>
        </tr>
      </table></xsl:attribute>
        more details
    </a>
    
    <a href="">
      <xsl:attribute name="title">
         <xsl:value-of select="concat('Source: ', source, '&#10;')" />
         <xsl:value-of select="concat('Destination: ', destination, '&#10;')" />
         <xsl:value-of select="concat('VLAN: ', source, '&#10;')" />
         <xsl:value-of select="concat('Date: ', date, '&#10;')" />
         <xsl:value-of select="concat('Count: ', count)" />
      </xsl:attribute>
      <xsl:text>more details</xsl:text>
    </a>