关于MS的 XML-DR (50分)

G

gephen

Unregistered / Unconfirmed
GUEST, unregistred user!
为什么只有去掉<推荐丛书 xmlns="x-schema:ex_mesxd.xml"> 中的xmlns="x-schema:ex_mesxd.xml"才能显示?
源文件如下:
文件ex_mexsd.xml:
<?xml version="1.0" encoding="GB2312" ?>
<!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by lymph (lymph) -->
<!--BizTalk Schema generated by XML Spy v4.4 U (http://www.xmlspy.com)-->
<?xml-stylesheet href="http://schemas.biztalk.org/BizTalk/g9boxjl2.xsl" type="text/xsl"?>
<Schema name="Untitled-schema" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="书籍" model="closed" content="eltOnly" order="seq">
<element type="名称" minOccurs="1" maxOccurs="1"/>
<element type="作者" minOccurs="1" maxOccurs="*"/>
<element type="售价" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="作者" model="closed" content="textOnly" dt:type="string"/>
<ElementType name="名称" model="closed" content="textOnly" dt:type="string"/>
<ElementType name="售价" model="closed" content="textOnly" dt:type="string">
<AttributeType name="货币单位" dt:type="enumeration" dt:values="人民币 新台币 港币" default="人民币" required="no"/>
<attribute type="货币单位"/>
</ElementType>
<ElementType name="推荐丛书" model="closed" content="eltOnly" order="seq">
<AttributeType name="xmlns" dt:type="string"/>
<attribute type="xmlns"/>
<element type="书籍" minOccurs="0" maxOccurs="*"/>
</ElementType>
</Schema>
文件ex_me.xslt:
<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head/>
<body>
<xsl:for-each select="推荐丛书">
<xsl:for-each select="书籍">
<xsl:if test="position()=1">
<xsl:text disable-output-escaping="yes">&amp;lt;table border="1"&amp;gt;</xsl:text>
</xsl:if>
<xsl:if test="position()=1">
<thead>
<tr>
<td>名称</td>
<td>作者</td>
<td>售价(<xsl:for-each select="售价">
<xsl:for-each select="@货币单位">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:for-each>)</td>
</tr>
</thead>
</xsl:if>
<xsl:if test="position()=1">
<xsl:text disable-output-escaping="yes">&amp;lt;tbody&amp;gt;</xsl:text>
</xsl:if>
<tr>
<td>
<xsl:for-each select="名称">
<xsl:apply-templates/>
</xsl:for-each>
</td>
<td>
<xsl:for-each select="作者">
<xsl:apply-templates/>
</xsl:for-each>
</td>
<td>
<xsl:for-each select="售价">
<xsl:apply-templates/>
</xsl:for-each>
</td>
</tr>
<xsl:if test="position()=last()">
<xsl:text disable-output-escaping="yes">&amp;lt;/tbody&amp;gt;</xsl:text>
</xsl:if>
<xsl:if test="position()=last()">
<xsl:text disable-output-escaping="yes">&amp;lt;/table&amp;gt;</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
文件ex_me.xml:
<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet type="text/xsl" href="ex_1.xslt"?>
<推荐丛书>
<!-- <推荐丛书 去掉 xmlns="x-schema:ex_mesxd.xml">
-->
<书籍>
<名称>煞死你的网页设计绝招</名称>
<作者>胭脂虎</作者>
<售价 货币单位="新台币">590</售价>
</书籍>
<书籍>
<名称>如何在 7-11 白吃白喝</名称>
<作者>无名氏</作者>
<售价 货币单位="新台币">120</售价>
</书籍>
</推荐丛书>
<推荐丛书>
 
顶部