<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<grammar datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
         xmlns="http://relaxng.org/ns/structure/1.0"
         xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
<!-- ===================================================================

     Apache Cocoon Book RELAX NG grammar (Version 0.1)

PURPOSE:
  DRAFT RELAX NG grammar for the Cocoon book.xml configuration files.

NOTES:

FIXME:
- 

CHANGE HISTORY:
20021030 V0.1 Initial RELAX NG grammar generated from book-cocoon-v10.dtd
              using DTDinst (DC)
     
==================================================================== -->
  <define name="book">
    <element name="book">
      <ref name="attlist.book"/>
      <oneOrMore>
        <ref name="menu"/>
      </oneOrMore>
    </element>
  </define>
  <define name="menu">
    <element name="menu">
      <ref name="attlist.menu"/>
      <zeroOrMore>
        <choice>
          <ref name="menu-item"/>
          <ref name="external"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="menu-item">
    <element name="menu-item">
      <ref name="attlist.menu-item"/>
      <empty/>
    </element>
  </define>
  <define name="external">
    <element name="external">
      <ref name="attlist.external"/>
      <empty/>
    </element>
  </define>
  <define name="attlist.book" combine="interleave">
    <attribute name="software"/>
    <attribute name="title"/>
    <attribute name="copyright"/>
    <empty/>
  </define>
  <define name="attlist.menu" combine="interleave">
    <attribute name="label"/>
  </define>
  <define name="attlist.menu-item" combine="interleave">
    <attribute name="label"/>
    <attribute name="href"/>
    <optional>
      <attribute name="type" a:defaultValue="visible">
        <choice>
          <value>visible</value>
          <value>hidden</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.external" combine="interleave">
    <attribute name="label"/>
    <attribute name="href"/>
    <optional>
      <attribute name="type" a:defaultValue="visible">
        <choice>
          <value>visible</value>
          <value>hidden</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <start>
    <choice>
      <ref name="book"/>
    </choice>
  </start>
</grammar>
