以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XML源码及示例(仅原创和转载) 』  (http://bbs.xml.org.cn/list.asp?boardid=32)
----  [求助]照别人的程序改的为什么没有正确结果啊??  (http://bbs.xml.org.cn/dispbbs.asp?boardid=32&rootid=&id=39017)


--  作者:maths_www
--  发布时间:10/17/2006 8:42:00 PM

--  [求助]照别人的程序改的为什么没有正确结果啊??
我的test.xml如下:
<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet type="text/xsl" href="test_template.xsl"?>
<vshow>
<info>
 <version>1.0</version>
 <channel>50409c80-4ef4-11db-aa2a-005056c00008</channel>
 <users>30</users>
 <title>cctv5 中央5</title>
 <class>电视直播</class>
 <url>www.v111.com</url>
 <description></description>
 <encrypt>false</encrypt>
</info>

<info>
 <version>1.0</version>
 <channel>457428ea-257a-7245-859a-21a6a96aab1d</channel>
 <users>20</users>
 <title>ny</title>
 <class>喜剧片</class>
 <url>www.v111.com</url>
 <description></description>
 <root>192.168.0.100:3581</root>
 <encrypt>false</encrypt>
</info>

</vshow>

我的test_template.xsl如下:
<?xml version="1.0" encoding="GB2312"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<!--根模板-->
<xsl:template match="/">
<HTML>
<HEAD>
</HEAD>
<BODY>
<xsl:apply-templates select="vshow/info"/>
</BODY>
</HTML>
</xsl:template>

<!--info-->
<xsl:template match="info">
<xsl:apply-templates select="title"/>(<xsl:apply-templates select="users"/>)
<BR/>
</xsl:template>

<!--title-->
<xsl:template match="title">

<a target="_blank">
<xsl:attribute name="href">
http://<xsl:value-of select="url"/>
</xsl:attribute>
<xsl:value-of />
</a>

</xsl:template>

<!--users-->
<xsl:template match="users">
<xsl:value-of/>
</xsl:template>

<!--url-->
<xsl:template match="url">
<xsl:value-of/>
</xsl:template>

</xsl:stylesheet>

显示结果是:
cctv5 中央5 (30 )
ny (20 )

其中的超连接部分是:http:///
这是为什么???我觉得正常结果应该是http://www.v111.com/


--  作者:Qr
--  发布时间:10/18/2006 12:20:00 PM

--  
select="../url"
--  作者:maths_www
--  发布时间:10/18/2006 7:33:00 PM

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