<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
         xmlns:x="http://www.w3.org/1999/xhtml">

  <x:h1>Scripting Module</x:h1>

  <div>
    <x:h2>The script element</x:h2>

    <define name="script">
      <element name="script">
        <ref name="script.attlist"/>
        <choice>
          <text/>
          <ref name="script"/>
        </choice>
      </element>
    </define>

    <define name="script.attlist">
      <ref name="CommonTypeRequired.attrib"/>
      <optional>
        <attribute name="charset">
          <ref name="Charset.datatype"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="declare">
          <value>declare</value>
        </attribute>
      </optional>
      <optional>
        <attribute name="xml:space">
          <value>preserve</value>
        </attribute>
      </optional>
    </define>
  </div>

  <define name="head.misc" combine="choice">
    <ref name="script"/>
  </define>

  <define name="Script.class">
    <ref name="script"/>
  </define>

  <define name="Text.class" combine="choice">
    <ref name="Script.class"/>
  </define>

  <define name="Structural.class" combine="choice">
    <ref name="Script.class"/>
  </define>

</grammar>