WebDav命名空间模式

本文关键字:模式 命名空间 WebDav | 更新日期: 2023-09-27 18:01:22

任何人都可以为DAV (WebDav)命名空间提供任何xml模式来进行验证吗请求吗?

目标是在处理请求之前检查请求。我尝试用ggl搜索任何,但我找不到任何xsd:(

WebDav命名空间模式

我意识到这好像晚了6年,但只是为了防止其他人有这个问题…

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="DAV:" xmlns:dav="DAV:" elementFormDefault="qualified">
  <element name="propfind">
    <complexType>
      <choice>
        <sequence>
          <element name="allprop" />
          <element name="include" type="dav:include" minOccurs="0" />
        </sequence>
        <element name="propname" />
        <element name="prop" type="dav:prop" />
      </choice>
    </complexType>
  </element>
  <element name="multistatus">
    <complexType>
      <sequence maxOccurs="1">
        <element ref="dav:response" minOccurs="0" maxOccurs="unbounded" />
        <element name="responsedescription" type="string" minOccurs="0" />
      </sequence>
    </complexType>
  </element>
  <element name="response">
    <complexType>
      <sequence>
        <element name="href" type="anyURI" />
        <choice>
          <sequence>
            <element name="href" type="anyURI" minOccurs="0" maxOccurs="unbounded" />
            <element name="status" type="string" />
          </sequence>
          <element name="propstat" type="dav:propstat" maxOccurs="unbounded" />
        </choice>
        <element ref="dav:error" minOccurs="0" />
        <element name="responsedescription" type="string" minOccurs="0" />
      </sequence>
    </complexType>
  </element>
  <element name="propertyupdate">
    <complexType>
      <choice minOccurs="0" maxOccurs="unbounded">
        <element name="remove" type="dav:prop-remove" />
        <element name="set" type="dav:prop-set" />
      </choice>
    </complexType>
  </element>
  <element name="lockinfo">
    <complexType>
      <sequence>
        <element name="lockscope" type="dav:lockscope" />
        <element name="locktype" type="dav:locktype" />
        <element name="owner" minOccurs="0" type="dav:owner" />
      </sequence>
    </complexType>
  </element>
  <element name="prop" type="dav:prop" />
  <element name="supportedlock">
    <complexType>
      <sequence>
        <element name="lockentry" minOccurs="0" maxOccurs="unbounded">
          <complexType>
            <sequence>
              <element name="lockscope" type="dav:lockscope" />
              <element name="locktype" type="dav:locktype" />
            </sequence>
          </complexType>
        </element>
      </sequence>
    </complexType>
  </element>
  <complexType name="owner" mixed="true">
    <sequence>
      <any namespace="##other" minOccurs="0" maxOccurs="unbounded" />
    </sequence>
    <anyAttribute />
  </complexType>
  <complexType name="lockscope">
    <choice>
      <element name="shared" />
      <element name="exclusive" />
    </choice>
  </complexType>
  <complexType name="locktype">
    <choice>
      <element name="write" />
    </choice>
  </complexType>
  <complexType name="prop-remove">
    <sequence>
      <element name="prop" type="dav:prop" />
    </sequence>
  </complexType>
  <complexType name="prop-set">
    <sequence>
      <element name="prop" type="dav:prop" />
    </sequence>
  </complexType>
  <complexType name="prop">
    <sequence>
      <any namespace="##any" minOccurs="0" maxOccurs="unbounded" />
    </sequence>
  </complexType>
  <complexType name="activelock">
    <sequence>
      <element name="lockscope" type="dav:lockscope" />
      <element name="locktype" type="dav:locktype" />
      <element name="depth">
        <simpleType>
          <restriction base="string">
            <enumeration value="0" />
            <enumeration value="1" />
            <enumeration value="infinity" />
          </restriction>
        </simpleType>
      </element>
      <element name="owner" type="dav:owner" minOccurs="0" />
      <element name="timeout" type="dav:timeout" />
      <element name="locktoken" type="dav:locktoken" minOccurs="0" />
      <element name="lockroot" type="dav:lockroot" />
    </sequence>
  </complexType>
  <simpleType name="timeout">
    <restriction base="string">
      <pattern value="(Infinite)|(Second-'d+)" />
    </restriction>
  </simpleType>
  <complexType name="lockentry">
    <sequence>
      <element name="lockscope" type="dav:lockscope" />
      <element name="locktype" type="dav:locktype" />
    </sequence>
  </complexType>
  <complexType name="lockroot">
    <sequence>
      <element name="href" type="anyURI" />
    </sequence>
  </complexType>
  <complexType name="locktoken">
    <sequence>
      <element name="href" type="anyURI" />
    </sequence>
  </complexType>
  <complexType name="include">
    <sequence>
      <any namespace="##any" minOccurs="0" maxOccurs="unbounded" />
    </sequence>
  </complexType>
  <element name="error">
    <complexType>
      <choice maxOccurs="unbounded">
        <element name="lock-token-matches-request-uri" />
        <element name="lock-token-submitted">
          <complexType>
            <sequence>
              <element name="href" type="anyURI" maxOccurs="unbounded" />
            </sequence>
          </complexType>
        </element>
        <element name="no-conflicting-lock">
          <complexType>
            <sequence>
              <element name="href" type="anyURI" minOccurs="0" maxOccurs="unbounded" />
            </sequence>
          </complexType>
        </element>
        <element name="no-external-entities" />
        <element name="preserved-live-properties" />
        <element name="propfind-finite-depth" />
        <element name="cannot-modify-protected-property" />
        <any namespace="##other" />
      </choice>
    </complexType>
  </element>
  <complexType name="propstat">
    <sequence>
      <element name="prop" type="dav:prop" />
      <element name="status" type="string" />
      <element ref="dav:error" minOccurs="0" />
      <element name="responsedescription" type="string" minOccurs="0" />
      <element name="location" type="dav:location" minOccurs="0" />
    </sequence>
  </complexType>
  <complexType name="location">
    <sequence>
      <element name="href" type="anyURI" />
    </sequence>
  </complexType>
</schema>

1)您可以从规范中提取DTD,并使用JING进行转换。

2)话虽如此,不要。您很可能会创建无法处理完全有效请求的代码(考虑排序和可扩展性规则)。