<?xml version="1.0" encoding="UTF-8"?>
<!--
  xmldsig-allowAnyForeign.rnc
-->
<!--
#
# Copyright ©[2011] World Wide Web Consortium 
# (Massachusetts Institute of Technology,  
#  European Research Consortium for Informatics and Mathematics, 
#  Keio University). All Rights Reserved.  
# This work is distributed under the W3C® Software License [1] in the
# hope that it will be useful, but WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. 
# [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
#
-->
<!--  
  This schema mimicks <any ../> in xmldsig-core-schema.xsd.  
  When namespace="##other", any foreign element is allowed.
  When namespace="##any", any foreign element as well as 
  any element valid against xmldsig-core-schema.xsd is allowed.
  
  Schema authors might want to create a dedicated schema 
  for a collection of particular algorithms rather than 
  using this schema.
-->
<grammar ns="http://www.w3.org/2000/09/xmldsig#" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <define name="ds_CanonicalizationMethodType" combine="choice">
    <attribute name="Algorithm">
      <data type="anyURI">
        <except>
          <ref name="ds_CanonicalizationAlgorithms"/>
        </except>
      </data>
    </attribute>
    <zeroOrMore>
      <choice>
        <ref name="ds_anyForeignElement"/>
        <ref name="ds_anyDsElement"/>
      </choice>
    </zeroOrMore>
  </define>
  <define name="ds_SignatureMethodType" combine="choice">
    <attribute name="Algorithm">
      <data type="anyURI">
        <except>
          <ref name="ds_SignatureAlgorithms"/>
        </except>
      </data>
    </attribute>
    <optional>
      <!--
        It is allowed to use an HMACOutputLength element even when
        the agorithm is not "http://www.w3.org/2000/09/xmldsig#hmac-sha1"
      -->
      <element name="HMACOutputLength">
        <ref name="ds_HMACOutputLengthType"/>
      </element>
    </optional>
    <zeroOrMore>
      <ref name="ds_anyForeignElement"/>
    </zeroOrMore>
  </define>
  <define name="ds_TransformType" combine="choice">
    <attribute name="Algorithm">
      <data type="anyURI">
        <except>
          <ref name="ds_CanonicalizationAlgorithms"/>
          <ref name="ds_TransformAlgorithms"/>
        </except>
      </data>
    </attribute>
    <zeroOrMore>
      <!--
        It is allowed to use XPath elements even when
        the algorithm is not "http://www.w3.org/TR/1999/REC-xpath-19991116"
      -->
      <choice>
        <ref name="ds_anyForeignElement"/>
        <element name="XPath">
          <data type="string"/>
        </element>
      </choice>
    </zeroOrMore>
  </define>
  <define name="ds_DigestMethodType" combine="choice">
    <attribute name="Algorithm">
      <data type="anyURI">
        <except>
          <ref name="ds_DigestAlgorithms"/>
        </except>
      </data>
    </attribute>
    <zeroOrMore>
      <ref name="ds_anyForeignElement"/>
    </zeroOrMore>
  </define>
  <define name="ds_KeyInfoChild" combine="choice">
    <ref name="ds_anyForeignElement"/>
  </define>
  <define name="ds_KeyValueType" combine="choice">
    <ref name="ds_anyForeignElement"/>
  </define>
  <define name="ds_X509DataForeignChild" combine="choice">
    <ref name="ds_anyForeignElement"/>
  </define>
  <define name="ds_SPKIDataForeignChild" combine="choice">
    <ref name="ds_anyForeignElement"/>
  </define>
  <define name="ds_ObjectChild" combine="choice">
    <ref name="ds_anyForeignElement"/>
  </define>
  <define name="ds_SignaturePropertyChild" combine="choice">
    <ref name="ds_anyForeignElement"/>
  </define>
  <define name="ds_PGPDataForeignChild" combine="choice">
    <ref name="ds_anyForeignElement"/>
  </define>
</grammar>

