<?xml version="1.0" encoding="UTF-8"?>
<!--
  Lenient-Signature11.rnc
  
  Copyright 2011 W3C (Massachusetts Institute of Technology, 
  Institut National de Recherche en Informatique et en Automatique, 
  Keio University). All Rights Reserved.  http://www.w3.org/Consortium/Legal/
  
  Use and distribution of all schemas in this directory are permitted under the terms
  W3C Software Notice and License
  http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
-->
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
  <start>
    <ref name="anyForeignElementOrSignature"/>
  </start>
  <define name="anyForeignElementOrSignature">
    <choice>
      <element>
        <anyName>
          <except>
            <nsName ns="http://www.w3.org/2000/09/xmldsig#"/>
            <nsName ns="http://www.w3.org/2009/xmldsig11#"/>
          </except>
        </anyName>
        <mixed>
          <zeroOrMore>
            <ref name="security_anyAttribute"/>
          </zeroOrMore>
          <zeroOrMore>
            <ref name="anyForeignElementOrSignature"/>
          </zeroOrMore>
        </mixed>
      </element>
      <ref name="ds_Signature"/>
    </choice>
  </define>
  <define name="ds_anyForeignElement">
    <element>
      <anyName>
        <except>
          <nsName ns="http://www.w3.org/2000/09/xmldsig#"/>
        </except>
      </anyName>
      <mixed>
        <zeroOrMore>
          <ref name="security_anyAttribute"/>
        </zeroOrMore>
        <zeroOrMore>
          <ref name="security_anyElement"/>
        </zeroOrMore>
      </mixed>
    </element>
  </define>
  <define name="dsig11_anyForeignElement">
    <element>
      <anyName>
        <except>
          <nsName ns="http://www.w3.org/2009/xmldsig11#"/>
        </except>
      </anyName>
      <mixed>
        <zeroOrMore>
          <ref name="security_anyAttribute"/>
        </zeroOrMore>
        <zeroOrMore>
          <ref name="security_anyElement"/>
        </zeroOrMore>
      </mixed>
    </element>
  </define>
  <include href="security_any.rng"/>
  <include href="xmldsig-core-schema.rng"/>
  <include href="xmldsig11-schema.rng"/>
  <include href="xmldsig-allowAnyForeign.rng"/>
  <include href="xmldsig11-allowAnyForeign.rng"/>
</grammar>
