<?xml version="1.0" encoding="UTF-8"?>
<!-- DTD for RELAX NG

     Author: Masayasu Ishikawa <mimasa@w3.org>
     $Id: relaxng.dtd,v 1.3 2002/09/30 02:46:30 mimasa Exp $

     DISCLAIMER: This is an UNOFFICIAL, INCOMPLETE, INCORRECT RELAX NG DTD
       just for my personal use. The sole purpose of this DTD is to help
       authoring of RELAX NG schemas (e.g. for use with DTD-driven authoring
       tools). It is TOTALLY INAPPROPRIATE to use this DTD for validation.
       DTD cannot fully express constraints of RELAX NG, and in some places
       definitions are intentionally altered for my convenience.  Be sure to
       use RELAX NG validators to check validity of RELAX NG schemas.
-->

<!-- namespaces -->
<!ENTITY % RELAXNG.xmlns "http://relaxng.org/ns/structure/1.0">
<!ENTITY % Annotations.xmlns
	"http://relaxng.org/ns/compatibility/annotations/1.0"
>
<!ENTITY % DatatypeLibrary.xmlns "http://www.w3.org/2001/XMLSchema-datatypes">

<!-- Annotations -->
<!ENTITY % annotations   "a">
<!ENTITY % documentation "%annotations;:documentation">
<!ENTITY % defaultValue  "%annotations;:defaultValue">

<!ELEMENT %documentation; (#PCDATA)>

<!-- content model patterns -->
<!ENTITY % pattern
	"element | attribute | group | interleave | choice | optional |
         zeroOrMore | oneOrMore | list | mixed | ref | parentRef | empty |
         text | value | data | notAllowed | externalRef | grammar"
>
<!ENTITY % grammarContent "start | define | div | include">
<!ENTITY % includeContent "start | define | div">
<!--ENTITY % nameClass    "name | anyName | nsName | choice"-->
<!ENTITY % nameClass      "name | anyName | nsName">
<!ENTITY % method         "(choice|interleave)">

<!-- extensions -->
<!ENTITY % ext            " | %documentation;">
<!ENTITY % GrammarContent "%grammarContent;%ext;">
<!ENTITY % IncludeContent "%includeContent;%ext;">
<!ENTITY % Pattern        "%pattern;%ext;">
<!ENTITY % extensionAtts "">

<!-- common attributes -->
<!ENTITY % commonAtts
       "ns                  CDATA #IMPLIED
	xmlns               CDATA '%RELAXNG.xmlns;'
	xmlns:%annotations; CDATA '%Annotations.xmlns;'
	datatypeLibrary     CDATA '%DatatypeLibrary.xmlns;'
        xml:lang            CDATA #IMPLIED
        %extensionAtts;"
>

<!-- restrict usage for convenience -->
<!ENTITY % restricted "INCLUDE">

<!-- the name attribute is not required when nameClass is used in content -->
<![%restricted;[
<!ENTITY % name-att
	"name CDATA #REQUIRED"
>
]]>
<!ENTITY % name-att
	"name CDATA #IMPLIED"
>

<!-- RELAX NG elements -->
<!ELEMENT grammar (%GrammarContent;)*>
<!ATTLIST grammar %commonAtts;>

<![%restricted;[
<!ENTITY % start.content "((%documentation;)?, (choice|ref|element))">
]]>
<!ENTITY % start.content "(%Pattern;)">
<!ELEMENT start %start.content;>
<!ATTLIST start
	%commonAtts;
	combine %method; #IMPLIED
>

<!ELEMENT define (%Pattern;)+>
<!ATTLIST define
	%commonAtts;
	name CDATA #REQUIRED
	combine %method; #IMPLIED
>

<!ELEMENT div (%GrammarContent;)*>
<!ATTLIST div %commonAtts;>

<!ELEMENT include (%IncludeContent;)*>
<!ATTLIST include
	%commonAtts;
	href CDATA #REQUIRED
>

<!ELEMENT element (%nameClass; | %Pattern;)+>
<!ATTLIST element
	%commonAtts;
	%name-att;
>

<!ELEMENT attribute (%nameClass; | %Pattern;)>
<!ATTLIST attribute
	%commonAtts;
	%name-att;
	%defaultValue; CDATA #IMPLIED
>

<!ELEMENT group      (%Pattern;)+>
<!ATTLIST group      %commonAtts;>

<!ELEMENT interleave (%Pattern;)+>
<!ATTLIST interleave %commonAtts;>

<!ELEMENT choice     (%Pattern;)+>
<!ATTLIST choice     %commonAtts;>

<!ELEMENT optional   (%Pattern;)+>
<!ATTLIST optional   %commonAtts;>

<!ELEMENT zeroOrMore (%Pattern;)+>
<!ATTLIST zeroOrMore %commonAtts;>

<!ELEMENT oneOrMore  (%Pattern;)+>
<!ATTLIST oneOrMore  %commonAtts;>

<!ELEMENT list       (%Pattern;)+>
<!ATTLIST list       %commonAtts;>

<!ELEMENT mixed      (%Pattern;)+>
<!ATTLIST mixed      %commonAtts;>

<!ELEMENT ref EMPTY>
<!ATTLIST ref
	%commonAtts;
	name CDATA #REQUIRED
>

<!ELEMENT parentRef EMPTY>
<!ATTLIST parentRef
	%commonAtts;
	name CDATA #REQUIRED
>

<!ELEMENT empty EMPTY>
<!ATTLIST empty %commonAtts;>

<!ELEMENT text  EMPTY>
<!ATTLIST text  %commonAtts;>

<!ELEMENT value (#PCDATA)>
<!ATTLIST value
	%commonAtts;
	type CDATA #IMPLIED
>

<!ELEMENT data (param*|except)>
<!ATTLIST data
	%commonAtts;
	type CDATA #REQUIRED
>

<!ELEMENT notAllowed EMPTY>
<!ATTLIST notAllowed %commonAtts;>

<!ELEMENT externalRef EMPTY>
<!ATTLIST externalRef
	%commonAtts;
	href CDATA #REQUIRED
>

<!ELEMENT name    (#PCDATA)>
<!ATTLIST name    %commonAtts;>

<!ELEMENT anyName (except?)>
<!ATTLIST anyName %commonAtts;>

<!ELEMENT nsName  (except?)>
<!ATTLIST nsName  %commonAtts;>

<!ELEMENT except  (%nameClass;)+>

<!ELEMENT param   (#PCDATA)>
<!ATTLIST param
	name CDATA #REQUIRED
>
