【发布时间】:2012-03-31 14:53:27
【问题描述】:
我很难引用所有 3 个。 我已经编写了我的 XML、XSD 和 XSL,但它似乎不适用于引用。 这是一个使用相同引用的简单示例。
XSD:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3schools.com"
xmlns="http://www.w3schools.com"
elementFormDefault="qualified">
<xs:element name="email">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
XML:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="email.xsl"?>
<email
xmlns="http://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3schools.com email.xsd">
<to>John</to>
</email>
XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="email">
<h2>To</h2>
<td><xsl:value-of select="John"/></td>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
【问题讨论】:
-
那么问题是什么?我没有看到一个。问题是什么?没有任何东西被描述为有问题。