1

この既存のXSDがあり、値をURLに制限しようとしていますが、機能していません。IDは空白であり、ドキュメントは引き続き検証されます。また、テキストを入力したときにも検証されます。

<xsd:schema xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/2005/Atom" elementFormDefault="qualified" attributeFormDefault="unqualified">
...

<xsd:complexType name="feedType">
<xsd:choice minOccurs="3" maxOccurs="unbounded">
    <xsd:element name="id" type="atom:idType" minOccurs="1" maxOccurs="1"/>
...

<xsd:complexType name="idType">
    <xsd:annotation>
        <xsd:documentation>
            The Atom id construct is defined in section 4.2.6 of the format spec.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleContent>
        <xsd:extension base="xsd:anyURI">
            <xsd:attributeGroup ref="atom:commonAttributes"/>
        </xsd:extension>
    </xsd:simpleContent>
</xsd:complexType>

...........。

<feed xmlns="http://www.w3.org/2005/Atom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.w3.org/2005/Atom ../XMLschemas/atom/2005/v/0.2/atom.xsd">
    <id>https://mydomain.com</id>
4

1 に答える 1

1

anyURI相対URIも許可され、空の文字列は有効な相対URIです。ファセットを追加して、pattern必要なものに近づくために「://」を要求することができます。

スペックが言うように、

...実際には、[anyURI]の定義は、最小限の適合プロセッサに非常に控えめな義務を課すだけです。

于 2012-05-18T11:47:40.180 に答える