以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  特殊名称空间元素的疑问  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=67497)


--  作者:dragonxml
--  发布时间:9/22/2008 3:10:00 AM

--  特殊名称空间元素的疑问
xml如下
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="2_1.xslt" type="text/xslt"?>
<instructions>
 <instruction>copy</instruction>
 <instruction>output</instruction>
 <instruction>value-of</instruction>
 <instruction>template</instruction>
 <instruction>copy-of</instruction>
</instructions>
xslt如下
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
 <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
 <xsl:template match="instructions">
  <xsl:element name="xsl:stylesheet">
  <xsl:apply-templates select="*"></xsl:apply-templates>
  </xsl:element>
 </xsl:template>
 <xsl:template match="*">
  <xsl:element name="xsl:{.}"></xsl:element>
 </xsl:template>
</xsl:stylesheet>

输出结果要是下面这样
<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:copy>
<xsl:output>
<xsl:value-of>
<xsl:template>
<xsl:copy-of>
</xsl:stylesheet》
但是我的输出结果确实
copy output value-of template copy-of
不知怎么解决呢


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms