-1

我尝试以下但收到错误

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xhtml="http://www.w3.org/1999/xhtml">   
    <xsd:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="xhtml.xsd" />

    <xsd:element name="book" type="bookType"/>

    <xsd:complexType name="bookType">
        <xsd:all>
            <xsd:element name="title" type="xsd:string"/>
            <xsd:element name="author" type="xsd:string"/>
            <xsd:element ref="xhtml:pre"/>
            <xsd:element ref="xhtml:ul"/>
        </xsd:all>
    </xsd:complexType>
</xsd:schema>

它返回一个错误<xsd:element ref="xhtml:pre"/>

4

1 回答 1

0

尝试这个:

    <xsd:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd" />

而不是你的进口。它将在 XML Spy 中进行验证。

于 2012-10-09T19:58:58.517 回答