<?xml version="1.0" encoding="UTF-8"?>
<chapter>
  <title>REXML Architecture</title>

  <sect1>
    <title>Overview</title>

    <para>REXML is separated into three main API layers, based on function:
    parsers, nodeset access APIs, and evaluators. The nodeset access APIs and
    the evaluators are what programmers interface with to use REXML.</para>

    <mediaobject>
      <textobject>
        <para>Architecture diagram</para>
      </textobject>

      <imageobject>
        <imagedata fileref="../images/architecture.svg" />
      </imageobject>
    </mediaobject>
  </sect1>

  <sect1>
    <title>Parsers</title>

    <para>REXML is based on a core set of parsers. There are currently two
    parsers: one for XML, and one for XPaths. Source for the parsers are
    located in <filename>src/rexml/parsers/</filename>.</para>
  </sect1>

  <sect1>
    <title>Nodeset Access APIs</title>

    <para>These are what most people see. The original REXML API, the SAX2
    API, the Pull Parser API, a DOM API... these all belong in this category.
    They use the core parser API to do their work. All of these APIs should
    implement the abstract node API, if they want to be useable with the
    higher-level evaluators.</para>
  </sect1>

  <sect1>
    <title>Evaluators</title>

    <para>Evaluators are high-level workers, and include things like XML
    output writers and XPath interpreters. Evaluators use the parsers and the
    abstract node API; any XML access API that conforms to the abstract node
    API should be useable with the evaluators.</para>
  </sect1>

  <sect1>
    <title>The Abstract Node API</title>

    <para>The abstract node API is a minimal set of methods that must be
    implemented by a nodeset access API if it is to be used by evaluators.</para>
  </sect1>
</chapter>