用于xhtml的自定义XSD

用于xhtml的自定义XSD,xsd,Xsd,我正在尝试以下操作,但出现错误 <?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" />

我正在尝试以下操作,但出现错误

<?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:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd" />


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

请提供您正在使用的解析器、您得到的错误、您正在验证的文档,以及您试图解决错误的内容列表。好的,说“它正在返回…架构本身有错误”就是进度。下一步是阅读错误信息,或者至少告诉那些试图回答你问题的人错误信息是什么。(可能原因:指示位置中没有xhtml.xsd。)