<?xml version="1.0" encoding="UTF-8"?>
<!--
  This file is part of DocBook V5.0
  
  Copyright 1992-2008 HaL Computer Systems, Inc.,
  O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
  Corporation, Norman Walsh, Sun Microsystems, Inc., and the
  Organization for the Advancement of Structured Information
  Standards (OASIS).
  
  Release: $Id: annotations.rnc 8931 2010-10-20 13:29:20Z nwalsh $
  
  Permission to use, copy, modify and distribute the DocBook schema
  and its accompanying documentation for any purpose and without fee
  is hereby granted in perpetuity, provided that the above copyright
  notice and this paragraph appear in all copies. The copyright
  holders make no representation about the suitability of the schema
  for any purpose. It is provided "as is" without expressed or implied
  warranty.
  
  If you modify the DocBook schema in any way, label your schema as a
  variant of DocBook. See the reference documentation
  (http://docbook.org/tdg5/en/html/ch05.html#s-notdocbook)
  for more information.
  
  Please direct all questions, bug reports, or suggestions for changes
  to the docbook@lists.oasis-open.org mailing list. For more
  information, see http://www.oasis-open.org/docbook/.
  
  ======================================================================
-->
<grammar ns="http://docbook.org/ns/docbook" xmlns:db="http://docbook.org/ns/docbook" xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:ctrl="http://nwalsh.com/xmlns/schema-control/" xmlns="http://relaxng.org/ns/structure/1.0">
  <start combine="choice">
    <ref name="db.annotation"/>
  </start>
  <define name="db.ubiq.inlines" combine="choice">
    <ref name="db.annotation"/>
  </define>
  <define name="db.all.blocks" combine="choice">
    <ref name="db.annotation"/>
  </define>
  <define name="db.info.elements" combine="choice">
    <ref name="db.annotation"/>
  </define>
  <define name="db.annotations.attribute">
    <attribute name="annotations">
      <db:refpurpose>Identifies one or more annotations that apply to this element</db:refpurpose>
    </attribute>
  </define>
  <define name="db.common.attributes" combine="interleave">
    <optional>
      <ref name="db.annotations.attribute"/>
    </optional>
  </define>
  <define name="db.common.idreq.attributes" combine="interleave">
    <optional>
      <ref name="db.annotations.attribute"/>
    </optional>
  </define>
  <!-- ====================================================================== -->
  <div>
    <db:refname>annotation</db:refname>
    <db:refpurpose>An annotation</db:refpurpose>
    <ctrl:exclude from="db.annotation" exclude="db.annotation"/>
    <define name="db.annotation.role.attribute">
      <attribute name="role"/>
    </define>
    <define name="db.annotation.annotates.attribute">
      <attribute name="annotates">
        <db:refpurpose>Identifies one ore more elements to which this annotation applies</db:refpurpose>
      </attribute>
    </define>
    <define name="db.annotation.attlist">
      <interleave>
        <optional>
          <ref name="db.annotation.role.attribute"/>
        </optional>
        <optional>
          <ref name="db.annotation.annotates.attribute"/>
        </optional>
        <ref name="db.common.attributes"/>
      </interleave>
    </define>
    <define name="db.annotation.info">
      <ref name="db._info.title.only"/>
    </define>
    <define name="db.annotation">
      <element name="annotation">
        <ref name="db.annotation.attlist"/>
        <ref name="db.annotation.info"/>
        <oneOrMore>
          <ref name="db.all.blocks"/>
        </oneOrMore>
      </element>
    </define>
  </div>
</grammar>
