-- 作者:booolee
-- 发布时间:3/20/2004 3:52:00 PM
-- 为什么取不出数据呢?
我使用XMLSPY2004编写了XML和XSL,但是在按F10测试运行后输出结果不正确(取不出数据),请高手帮我指点一下~~~ XML文件: <?xml version="1.0" encoding="GB2312"?> <document> <resume> <name>美眉C</name> <sex>女</sex> <birthday>2000.1.2</birthday> <skill>爱好上网</skill> </resume> <resume> <name>美眉D</name> <sex>女</sex> <birthday>1999.5.8</birthday> <skill>洗澡</skill> </resume> <resume> <name>美眉E</name> <sex>女</sex> <birthday>1992.3.15</birthday> <skill>打球</skill> </resume> </document> XSL文件: <?xml version="1.0" encoding="gb2312"?> <?xmlspysamplexml F:\output\xml\mm.xml?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <head> <title>MM列表</title> <meta content="text/html; charset=gb2312"/> </head> <body> <table> <xsl:for-each select="document/resume"> <tr> <xsl:apply-templates select="name"/> <xsl:apply-templates select="sex"/> <xsl:apply-templates select="birthday"/> <xsl:apply-templates select="skill"/> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> <xsl:template match="name"> <td> <xsl:value-of select="name"/> </td> </xsl:template> <xsl:template match="sex"> <td> <xsl:value-of select="sex"/> </td> </xsl:template> <xsl:template match="birthday"> <td> <xsl:value-of select="birthday"/> </td> </xsl:template> <xsl:template match="skill"> <td> <xsl:value-of select="skill"/> </td> </xsl:template> </xsl:stylesheet> 转换后的HTML文件: <html><head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>MM鍒楄〃</title><meta content="text/html; charset=gb2312"></head><body><table> <tr><td></td><td></td><td></td><td></td> </tr> <tr><td></td><td></td><td></td><td></td> </tr> <tr><td></td><td></td><td></td><td></td> </tr> </table> </body></html>
|