以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XSL/XSLT/XSL-FO/CSS 』  (http://bbs.xml.org.cn/list.asp?boardid=8)
----  [求助]急!!在线等……xml文档里标签的顺序显示  (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=62094)


--  作者:fengfengfeng
--  发布时间:5/2/2008 6:36:00 PM

--  [求助]急!!在线等……xml文档里标签的顺序显示
部分xml文档:
<contentL2 ID="1">
<titleL2>一、系统架构概述</titleL2>
<contents>本文的主要</contents>
<contents>本文的主要</contents>
<picture ID="1">logo.jpg</picture>
<picname ID="1">阿狸的故事</picname>
<contents>采用</contents>
<picture ID="1">logo.jpg</picture>
<picname ID="1">阿狸的故事</picname>
</contentL2>
<contentL2 ID="2">
<titleL2>一、系统架构概述</titleL2>
<contents>本文的主要</contents>
<picture ID="1">logo.jpg</picture>
<picname ID="1">阿狸的故事</picname>
<contents>采用</contents>
</contentL2>
请问怎么写xsl才能使上面的代码按在xml里的顺序显示?相同标签用一个格式显示,不同标签的格式不同。
谢了先


--  作者:Qr
--  发布时间:5/4/2008 12:29:00 PM

--  

如果不想打乱contentL2下各元素的顺序,<xsl:value-of select="*"/>可以实现。根据标签名定义不同格式,可以使用此法:<xsl:when test="name()='titleL2'">这是titleL2</xsl:when>,其它类似
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
2,230.469ms