0

我正在尝试使用 an 验证此 xhtml,xsd但找不到与此案例匹配的正确定义:

<tbody>

<tr id="uid95344" class=""></tr>
<tr class="sub"></tr>
<tr class="sub"></tr>

<tr id="uid95341" class=""></tr>

<tr id="uid94784" class=""></tr>
<tr class="sub"></tr>

</tbody>

提前致谢!

凯文

4

1 回答 1

0

这是我的xsd,怎么了?:

<?xml version="1.0"?>
<xs:schema elementFormDefault="qualified" targetNamespace="http://www.w3schools.com" xmlns="http://www.w3schools.com" xmlns:editix="http://www.w3schools.com" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:simpleType name="UUID">
        <xs:annotation>
            <xs:documentation>OperationID is constrained to: &quot;uuid[0-9]+&quot;</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:pattern value="uuid[0-9]+"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="SubClass">
        <xs:annotation>
            <xs:documentation>ExtensionClass is constrained to: &quot;sub&quot;</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:pattern value="sub"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:group name="uuidGroup">
        <xs:sequence>
            <xs:element name="tr">
                <xs:complexType>
                    <xs:attribute name="class" type="xs:string" use="optional"/>
                    <xs:attribute name="id" type="UUID" use="required"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:group>
    <xs:group name="subGroup">
        <xs:sequence>
            <xs:element name="tr">
                <xs:complexType>
                    <xs:attribute name="class" type="SubClass" use="required"/>
                    <xs:attribute name="id" type="xs:string" use="optional"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:group>
    <xs:element name="tbody">
        <xs:complexType>
            <xs:sequence maxOccurs="unbounded" minOccurs="0">
                <xs:group ref="uuidGroup"/>
                <xs:group ref="subGroup" maxOccurs="unbounded" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>
于 2013-06-11T15:59:45.800 回答