2

任何人都可以为 DAV 提供任何 xml 架构:(WebDav) 命名空间来验证请求吗?

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

4

2 回答 2

3

我意识到这已经晚了 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>
于 2020-02-04T14:13:12.123 回答
1

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

2)话虽这么说:不要。您可能会创建对于完全有效的请求失败的代码(考虑排序和可扩展性规则)。

于 2013-02-27T22:00:10.937 回答