<?xml version="1.0" encoding="UTF-8"?>

<!-- ====================================================================== -->
<!-- = appendix-ii.xml                                                    = -->
<!-- = standard xml module guide - appendix ii                            = -->
<!-- ====================================================================== -->
<!-- = This  program  is  free  software; you  can redistribute it and/or = -->
<!-- = modify it provided that this copyright notice is kept intact.      = -->
<!-- = This program is distributed in the hope that it will be useful but = -->
<!-- = without  any  warranty;  without  even  the  implied  warranty  of = -->
<!-- = merchantability or fitness for  a  particular purpose. In no event = -->
<!-- = shall  the  copyright  holder be liable for any  direct, indirect, = -->
<!-- = incidental  or special  damages arising  in any way out of the use = -->
<!-- = of this software.                                                  = -->
<!-- ====================================================================== -->
<!-- = copyright (c) 1999-2011 - amaury darsch                            = -->
<!-- ====================================================================== -->

<appendix module="xml" number="ii">
  <title>Standard xne reference</title>

  <!-- =================================================================== -->
  <!-- = xne system object                                               = -->
  <!-- =================================================================== -->

  <object nameset="afnix:xml">
    <name>Xne</name>

    <!-- synopsis -->
    <p>
      The <code>Xne</code> is a nameset that binds constants used
      by the xne system.
    </p>

    <!-- constants -->
    <constants>
      <const>
	<name>ID</name>
	<p>
	  The <code>ID</code> constant defines a node access by id.
	</p>
      </const>

      <const>
	<name>PI</name>
	<p>
	  The <code>PI</code> constant defines an access selector for a processing
	  instruction node.
	</p>
      </const>

      <const>
	<name>GE</name>
	<p>
	  The <code>GE</code> constant defines an access selector for a general
	  entity node.
	</p>
      </const>

      <const>
	<name>TAG</name>
	<p>
	  The <code>TAG</code> constant defines an access selector for a tag
	  node.
	</p>
      </const>

      <const>
	<name>ENT</name>
	<p>
	  The <code>ENT</code> constant defines an access selector for an entity
	  node.
	</p>
      </const>

      <const>
	<name>EREF</name>
	<p>
	  The <code>EREF</code> constant defines an access selector for an entity
	  reference node.
	</p>
      </const>

      <const>
	<name>CREF</name>
	<p>
	  The <code>CREF</code> constant defines an access selector for an
	  character reference node.
	</p>
      </const>

      <const>
	<name>ELEM</name>
	<p>
	  The <code>ELEM</code> constant defines an access selector for an
	  element node.
	</p>
      </const>

      <const>
	<name>TEXT</name>
	<p>
	  The <code>TEXT</code> constant defines an access selector for a
	  text node.
	</p>
      </const>

      <const>
	<name>NAME</name>
	<p>
	  The <code>NAME</code> constant defines a node access by name.
	</p>
      </const>

      <const>
	<name>CDATA</name>
	<p>
	  The <code>CDATA</code> constant defines an access selector for a
	  character data node.
	</p>
      </const>

      <const>
	<name>INDEX</name>
	<p>
	  The <code>INDEX</code> constant defines a node access by child
	  index. The child index is node index seen from the parent.
	</p>
      </const>
    </constants>
  </object>

  <!-- =================================================================== -->
  <!-- = xne tree object                                                 = -->
  <!-- =================================================================== -->

  <object nameset="afnix:xml">
    <name>XneTree</name>

    <!-- synopsis -->
    <p>
      The <code>XneTree</code> is the xne node tree manipulation
      class. The class operates with a node and provides numerous
      methods to manipulate the tree as well as  changing it. Before a
      tree is manipulated, it is recommended to make a copy of such tree
      with the help of the node <code>copy</code> method. 
    </p>

    <!-- predicate -->
    <pred>xne-tree-p</pred>

    <!-- inheritance -->
    <inherit>
      <name>Object</name>
    </inherit>

    <!-- constructors -->
    <ctors>
      <ctor>
	<name>XmlTree</name>
	<args>none</args>
	<p>
	  The <code>XmlTree</code> constructor creates a default tree
	  without a node.
	</p>
      </ctor>

      <ctor>
	<name>XmlTree</name>
	<args>XmlNode</args>
	<p>
	  The <code>XmlTree</code> constructor creates a tree with a xml
	  node. The node stored in the object is the root of the tree
	  subject to the operations.
	</p>
      </ctor>
    </ctors>

    <!-- methods -->
    <methods>
      <meth>
	<name>depth</name>
	<retn>Integer</retn>
	<args>none</args>
	<p>
	  The <code>depth</code> method returns the depth of the tree.
	</p>
      </meth>

      <meth>
	<name>generate-id</name>
	<retn>Integer</retn>
	<args>none</args>
	<p>
	  The <code>generate-id</code> method generate a unique id for all
	  node in the tree. The id attribute is set by this method.
	</p>
      </meth>

      <meth>
	<name>set-node</name>
	<retn>none</retn>
	<args>XmlNode</args>
	<p>
	  The <code>set-node</code> method sets the root tree node.
	</p>
      </meth>

      <meth>
	<name>get-node</name>
	<retn>XmlNode</retn>
	<args>none</args>
	<p>
	  The <code>get-node</code> method returns the root tree node.
	</p>
      </meth>

      <meth>
	<name>set-attribute</name>
	<retn>none</retn>
	<args>none|String</args>
	<p>
	  The <code>set-attribute</code> method sets an attribute to the
	  whole tree. In the first form, the attribute is set to the whole
	  tree. In the second form with a string argument, the attribute
	  is set only on the tag node those name matches the name argument.
	</p>
      </meth>

      <meth>
	<name>clear-attribute</name>
	<retn>none</retn>
	<args>none|String</args>
	<p>
	  The <code>clear-attribute</code> method clear all attributes of
	  the nodes in the tree. In the first form, the node attributes
	  are cleared for all nodes in the tree. In the second form with a
	  string argument, the attributes are cleared only with the tag
	  node those name matches the name argument.
	</p>
      </meth>

      <meth>
	<name>set-prefix</name>
	<retn>none</retn>
	<args>String</args>
	<p>
	  The <code>set-prefix</code> method sets a prefix on all nodes
	  in the tree.
	</p>
      </meth>

      <meth>
	<name>clear-prefix</name>
	<retn>none</retn>
	<args>none</args>
	<p>
	  The <code>clear-prefix</code> method clear the prefix for all
	  nodes in the tree.
	</p>
      </meth>

      <meth>
	<name>select</name>
	<retn>Vector</retn>
	<args>XneCond [Boolean]</args>
	<p>
	  The <code>select</code> method selects the node in the tree that
	  matches the condition argument. In the first form, with one
	  argument, the whole tree is searched. In the second form, with a
	  boolean argument, the whole tree is searched if the second
	  argument is false. If the boolean argument is true, the method
	  call behaves like a call with the condition only.
	</p>
      </meth>
    </methods>
  </object>
  
  <!-- =================================================================== -->
  <!-- = xne condition object                                            = -->
  <!-- =================================================================== -->

  <object nameset="afnix:xml">
    <name>XneChild</name>

    <!-- synopsis -->
    <p>
      The <code>XneCond</code> is the xne condition class. The sole
      purpose of this class is to define one or several condition that a
      node must satisfy in order to be selected. The condition are
      accumulated in a list and later checked for a particular
      node. Note that an empty condition always succeeds.
    </p>

    <!-- predicate -->
    <pred>xne-cond-p</pred>

    <!-- inheritance -->
    <inherit>
      <name>Object</name>
    </inherit>

    <!-- constructors -->
    <ctors>
      <ctor>
	<name>XneCond</name>
	<args>none</args>
	<p>
	  The <code>XneCond</code> constructor creates a default
	  condition. The default condition is empty. The empty condition
	  always succeeds.
	</p>
      </ctor>
    </ctors>

    <!-- methods -->
    <methods>
      <meth>
	<name>add</name>
	<retn>none</retn>
	<args>Xne [String|Integer]</args>
	<p>
	  The <code>add</code> adds a condition by type. The first
	  argument is the condition type. The second argument is a
	  condition information such like a string or an integer.
	</p>
      </meth>

      <meth>
	<name>valid-p</name>
	<retn>Boolean</retn>
	<args>XmlNode</args>
	<p>
	  The <code>valid-p</code> predicate checks that a node
	  matches a condition. If the condition succeeds, the predicate
	  returns true.
	</p>
      </meth>
    </methods>
  </object>
</appendix>
