以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XML基础 』  (http://bbs.xml.org.cn/list.asp?boardid=1)
----  XML中定义的一个TAG中的内容,如何最后让其以HTML代码输出?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=1&rootid=&id=8581)


--  作者:深蓝色系统
--  发布时间:7/1/2004 4:30:00 PM

--  XML中定义的一个TAG中的内容,如何最后让其以HTML代码输出?
首先在schema中我写了这么个类型:
<xs:complexType name="xhtmlType" mixed="true">
  <xs:sequence>
   <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
 </xs:complexType>

然后定义了一个名为“xanyText”的TAG,类型为上面的xhtmlType

然后我在XML文件中这么写

<xanyText>
<table border="1">
<tbody>
  <tr><td>sample code.<td></tr>
</tbody>
</table>
</xanyText>

我最后期望xanyText之间的内容,输出到浏览器不是文字 sample code
而是一个表格

怎么做?在xslt中是否有什么方法让xanyText不解析它包含的内容,
而直接将其作为文本输出去呢?

谢谢各位。


--  作者:深蓝色系统
--  发布时间:7/1/2004 5:37:00 PM

--  
考,这么简单,我自己解决了。

在xsl中这么写一句就行了:
<xsl:template match="xhtml">
<xsl:copy-of select="//xhtml/*" />
</xsl:template>


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