<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <include href="common.rng"/>
  <start combine="choice">
    <ref name="Viewer"/>
  </start>
  <define name="Viewer">
    <element name="viewer">
      <ref name="Service"/>
    </element>
  </define>
  <define name="InterfaceType" combine="interleave">
    <value>viewer</value>
  </define>
  <define name="InvocationParameterElements" combine="interleave">
    <optional>
      <ref name="Format">
        <a:documentation>javascript code to get back data from the viewer</a:documentation>
      </ref>
    </optional>
  </define>
  <define name="Format">
    <element name="format">
      <a:documentation>a single javascript chunk</a:documentation>
      <attribute name="base64encoded">
        <data type="boolean"/>
      </attribute>
      <optional>
        <attribute name="extension">
          <data type="string"/>
        </attribute>
      </optional>
      <ref name="Code"/>
    </element>
  </define>
</grammar>
