我对 XML Schema 有一些问题。我需要在我的 XML 文件中添加一些 HTML 代码,我发现 xs:any 会有所帮助。但是 xmllint 会返回如下错误:
example.xml:4: element h1: Schemas validity error : Element 'h1': This element is not expected. Expected is ( {http://www.w3.org/1999/xhtml}* ).
XML:
<?xml version="1.0" encoding="UTF-8"?>
<foo>
<bar>
<h1>Lorem ipsum</h1>
</bar>
</foo>
架构:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="foo">
<xs:complexType>
<xs:sequence>
<xs:element name="bar" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:any namespace="http://www.w3.org/1999/xhtml" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
我做错了什么?