以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XSL/XSLT/XSL-FO/CSS 』  (http://bbs.xml.org.cn/list.asp?boardid=8)
----  请问各位,有没有在XSL中,可以提取要素名称的方法?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=52635)


--  作者:阿三
--  发布时间:9/14/2007 2:44:00 PM

--  请问各位,有没有在XSL中,可以提取要素名称的方法?
请问各位,有没有在XSL中,可以提取要素名称的方法?
例如:<templete>
      能提取显示“templete”这个单词。
谢谢!

--  作者:Qr
--  发布时间:9/14/2007 3:27:00 PM

--  
name()
--  作者:阿三
--  发布时间:9/14/2007 3:43:00 PM

--  
可否写的详细一些?


--  作者:luypmp
--  发布时间:9/15/2007 5:27:00 PM

--  
http://www.w3schools.com/xpath/xpath_functions.asp有各种function的介绍!
name()可以看看这个
book.xml

<?xml version="1.0" encoding="GB2312"?>
<templates>
 <template>liar's poker</template>
</templates>

tran.xslt

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="html"/>
 <xsl:template match="/">
  <html>
   <head>
   </head>
   <body>
   <table>
    <xsl:apply-templates/>
   </table>
   </body>
  </html>
 </xsl:template>
 <xsl:template match="template">
  <tr>
   <td>
    <xsl:value-of select="name()"/>
   </td>
  </tr>
 </xsl:template>
</xsl:stylesheet>


--  作者:xingxing
--  发布时间:9/18/2007 5:03:00 PM

--  
假设只知道父节点templates名称,而不知道它的子节点template,如何获取?
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
6,312.012ms