-- 作者:yangxch
-- 发布时间:9/27/2004 3:05:00 PM
-- xsd模板规则是不是用错了,浏览xm文档时一片空白!l
xml文档 <?xml version="1.0" encoding="GB2312"?> <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by yang (yang) --> <?xml-stylesheet type="text/xsl" href="3-10.xsl"?> <CD> <商品> <定购人信息> <姓名>里斯</姓名> <详细地址> <街道>清华大学25号</街道> <城市>北京</城市> <省>北京</省> <国家>中国</国家> <邮政编码>100084</邮政编码> </详细地址> </定购人信息> <备注 付款方式="现金" 订货日期="2000-12-07">请赶紧发货,即用!</备注> </商品> <商品> <定购人信息> <姓名>张三</姓名> <详细地址> <街道>南京路555#</街道> <城市>上海</城市> <省>上海</省> <国家>中国</国家> <邮政编码>210002</邮政编码> </详细地址> </定购人信息> <备注 付款方式="信用卡" 订货日期="2000-12-08">请在15天内寄到!</备注> </商品> </CD> xsl文档 <?xml version="1.0" encoding="GB2312"?> <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by yang (yang) --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!--根模板--> <xsl:template match="/"> <html> <head> <title>订购信息</title> </head> <body> <xsl:apply-templates select="CD/商品/订购人信息"/> </body> </html> </xsl:template> <!--订购人信息--> <xsl:template match="订购人信息"> <table border="1" cellpadding="0"> <xsl:apply-templates select="姓名"/> <xsl:apply-templates select="详细地址"/> <tr/> </table> </xsl:template> <!--姓名模板--> <xsl:template match="姓名"> <td>姓名</td> <td> <xsl:value-of select="."/> </td> </xsl:template> <!--地址模板--> <xsl:template match="详细地址"> <table border="1" cellpadding="0"> <xsl:apply-templates select="街道"/> <xsl:apply-templates select="城市"/> <xsl:apply-templates select="省|直辖市"/> <xsl:apply-templates select="国家"/> <xsl:apply-templates select="邮政编码"/> </table> </xsl:template> <!--街道模板--> <xsl:template match="街道"> <td>街道</td> <td> <xsl:value-of select="."/> </td> </xsl:template> <!--城市模板--> <xsl:template match="城市"> <td>城市</td> <td> <xsl:value-of select="."/> </td> </xsl:template> <!--省|直辖市模板--> <xsl:template match="省|直辖市"> <td>省|直辖市</td> <td> <xsl:value-of select="."/> </td> </xsl:template> <!--国家模板--> <xsl:template match="国家"> <td>国家</td> <td> <xsl:value-of select="."/> </td> </xsl:template> <!--邮政编码模板--> <xsl:template match="邮政编码"> <td>邮政编码</td> <td> <xsl:value-of select="."/> </td> </xsl:template> </xsl:stylesheet> 模板运用那儿出错了??
|