dleslie     00/07/28 09:21:10

  Modified:    xdocs/sources/design design2_0_0.xml
  Log:
  Fixed links and added TOC
  
  Revision  Changes    Path
  1.3       +51 -37    xml-xalan/xdocs/sources/design/design2_0_0.xml
  
  Index: design2_0_0.xml
  ===================================================================
  RCS file: /home/cvs/xml-xalan/xdocs/sources/design/design2_0_0.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- design2_0_0.xml   2000/07/28 13:30:07     1.2
  +++ design2_0_0.xml   2000/07/28 16:21:09     1.3
  @@ -2,13 +2,27 @@
   <!DOCTYPE s1 SYSTEM "sbk:/style/dtd/document.dtd">
   <s1 title="Xalan-J 2.0 Design">
     <p><link>Xalan-J 2.0 Design</link><img src="xmllogo.gif" 
alt="xmllogo.gif"/></p>
  +  <p>Author: Scott Boag<br/>State: In Progress</p>
     <ul> 
  -      <li>Author: Scott Boag</li> 
  -      <li>State: In Progress</li>
  +        <li><link anchor="intro">Introduction</link></li>
  +        <li><link anchor="overarch">Overview of Architecture</link></li>
  +        <li><link anchor="process">Process Module</link></li>
  +        <li><link anchor="templates">Templates Module</link></li>
  +        <li><link anchor="transformer">Transformer Module</link></li>
  +       <ul>
  +         <li><link anchor="stree">Stree Module</link></li>
  +         <li><link anchor="extensions">Extensions Module</link></li>
  +     </ul>
  +        <li><link anchor="xpath">XPath Module</link></li>
  +       <ul><li><link anchor="xpathdbconn">XPath Database 
Connection</link></li></ul>
  +        <li><link anchor="utils">Utils Package</link></li>         
  +        <li><link anchor="other">Other Packages</link></li>         
  +        <li><link anchor="coding">Coding Conventions</link></li>
  +        <li><link anchor="open">Open Issues</link></li>     
      <li><jump href="http://xml.apache.org/xalan-j/apidocs/index.html";>Xalan-J 
2.0 Javadoc</jump></li>
  -  </ul>
  +  </ul><anchor name="intro"/>
     <s2 title="Introduction"> 
  -      <p><link idref="intro">Introduction</link></p> 
  +      <p><link>Introduction</link></p> 
         <p>This document presents the basic design for Xalan-J 2.0, which is a
                <jump 
href="http://www.awl.com/cseng/titles/0-201-89542-0/techniques/refactoring.htm";>refactoring</jump>
                and redesign of the Xalan-J 1.x processor. The main goals of 
this redesign are
  @@ -45,38 +59,38 @@
                  expect that the code will be faster once this work is 
complete.</li> 
         </ol> 
         <p>How well we've achieved the goals will be measured by feedback from 
the
  -             <link 
anchor="http://xml-archive.webweaving.org/xml-archive-xalan";>Xalan-dev</link> 
list, and by software metrics tools.</p> 
  +             <jump 
href="http://xml-archive.webweaving.org/xml-archive-xalan";>Xalan-dev</jump> 
list, and by software metrics tools.</p> 
         <p>Please note that the diagrams in this design document are meant to 
be
                useful abstractions, and may not always be exact.</p> 
  -  </s2> 
  +  </s2><anchor name="overarch"/> 
     <s2 title="Overview of Architecture"> 
  -      <p><link idref="overview">Overview of Architecture</link></p> 
  +      <p><link>Overview of Architecture</link></p> 
         <p>Xalan 2.0 is divided into four major modules, and various smaller
                modules. The main modules are:</p> 
         <gloss> 
  -             <label><code><link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/processor/package-summary.html";>org.apache.xalan.process</link></code></label>
 
  +             <label><code><jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/processor/package-summary.html";>org.apache.xalan.process</jump></code></label>
 
                <item>The module that processes the stylesheet, and provides 
the main
                  entry point into Xalan.</item> 
         </gloss> 
         <gloss> 
  -             <label><code><link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/templates/package-summary.html";>org.apache.xalan.templates</link></code></label>
 
  +             <label><code><jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/templates/package-summary.html";>org.apache.xalan.templates</jump></code></label>
 
                <item>The module that defines the stylesheet structures, 
including the
                  Stylesheet object, template element instructions, and 
Attribute Value
                  Templates. </item> 
         </gloss> 
         <gloss> 
  -             <label><code><link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/transformer/package-summary.html";>org.apache.xalan.transformer</link></code></label>
 
  +             <label><code><jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/transformer/package-summary.html";>org.apache.xalan.transformer</jump></code></label>
 
                <item>The module that applies the source tree to the Templates, 
and
                  produces a result tree.</item> 
         </gloss> 
         <gloss> 
  -             <label><code><link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xpath/package-summary.html";>org.apache.xpath</link></code></label>
 
  +             <label><code><jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xpath/package-summary.html";>org.apache.xpath</jump></code></label>
 
                <item>The module that processes both XPath expressions, and 
XSLT Match
                  patterns.</item> 
         </gloss> 
         <p>In addition to the above modules, Xalan implements the
  -             <link anchor="http://trax.openxml.org/";>TrAX</link> interfaces, 
and depends on the
  -      <link 
anchor="http://www.megginson.com/SAX/Java/index.html";>SAX2</link> and <link 
anchor="http://www.w3.org/TR/DOM-Level-2/";>DOM</link> packages.
  +             <jump href="http://trax.openxml.org/";>TrAX</jump> interfaces, 
and depends on the
  +      <jump href="http://www.megginson.com/SAX/Java/index.html";>SAX2</jump> 
and <jump href="http://www.w3.org/TR/DOM-Level-2/";>DOM</jump> packages.
   </p><p><img src="trax.gif" alt="trax.gif"/></p><p>There is also a general 
utilities package that contains both XML utility
         classes such as QName, but generally useful classes such as
         StringToIntTable.</p> 
  @@ -86,41 +100,41 @@
         <p>In addition to the above packages, there are the following 
additional
                packages:</p> 
         <gloss> 
  -             <label><code><link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/client/package-summary.html";>org.apache.xalan.client</link></code></label>
 
  +             <label><code><jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/client/package-summary.html";>org.apache.xalan.client</jump></code></label>
 
                <item>This package has a client applet. I suspect this should 
be moved
                  into the samples directory.</item> 
         </gloss> 
         <gloss> 
  -             <label><code><link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/extensions/package-summary.html";>org.apache.xalan.extensions</link></code></label>
 
  +             <label><code><jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/extensions/package-summary.html";>org.apache.xalan.extensions</jump></code></label>
 
                <item>This holds classes belonging to the Xalan extensions 
mechanism,
                  which allows Java code and script to be called from within a 
stylesheet.</item>
                
         </gloss> 
         <gloss> 
  -             <label><code><link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/lib/package-summary.html";>org.apache.xalan.lib</link></code></label>
 
  +             <label><code><jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/lib/package-summary.html";>org.apache.xalan.lib</jump></code></label>
 
                <item>This is the built-in Xalan extensions library, which holds
                  extensions such as Redirect (which allows a stylesheet to 
produce multiple
                  output files).</item> 
         </gloss> 
         <gloss> 
  -             <label><code><link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/res/package-summary.html";>org.apache.xalan.res</link></code></label>
 
  +             <label><code><jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/res/package-summary.html";>org.apache.xalan.res</jump></code></label>
 
                <item>This holds resource files needed by Xalan, such as error 
message
                  resources.</item> 
         </gloss> 
         <gloss> 
  -             <label><code><link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/trace/package-summary.html";>org.apache.xalan.trace</link></code></label>
 
  +             <label><code><jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/trace/package-summary.html";>org.apache.xalan.trace</jump></code></label>
 
                <item>This package contains classes and interfaces that allow a 
caller to
                  add trace listeners to the transformation, allowing an 
interface to XSLT
                  debuggers and similar tools.</item> 
         </gloss> 
         <gloss> 
  -             <label><code><link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/xslt/package-summary.html";>org.apache.xalan.xslt</link></code></label>
 
  +             <label><code><jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/xslt/package-summary.html";>org.apache.xalan.xslt</jump></code></label>
 
                <item>This package is for backwards compatibility with 
applications that
                  depend on Xalan 1.x interfaces.</item> 
         </gloss> 
     <p>A more conceptual view of this architecture is as follows:</p><p><img 
src="conceptual.gif" alt="Picture of conceptual 
architecture."/></p></s2><anchor name="process"/> 
     <s2 title="Process Module"> 
  -      <p><link idref="process">Process Module</link></p> 
  +      <p><link>Process Module</link></p> 
         <p>The <code>org.apache.xalan.process</code> module implements the
                <code>org.apache.xalan.trax.Processor</code> interface, which 
provides a
                factory method for creating a concrete Processor instance, and 
provides methods
  @@ -159,7 +173,7 @@
         <p><img src="process.gif" alt="process.gif"/></p> 
     </s2><anchor name="templates"/> 
     <s2 title="Templates Module"> 
  -      <p><link idref="templates">Templates Module</link></p> 
  +      <p><link>Templates Module</link></p> 
         <p>The <code>org.apache.xalan.templates</code> module implements the
                <code>org.apache.xalan.trax.Templates</code> interface, and 
defines a set of
                classes that represent a Stylesheet. The primary purpose of 
this module is to
  @@ -387,8 +401,8 @@
         </table> 
     </s2><anchor name="transformer"/> 
     <s2 title="Transformer Module"> 
  -      <p><link idref="transformer">Transformer Module</link></p> 
  -      <p>The <link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/transformer/package-summary.html";>Transformer</link>
 module is in charge of run-time transformations.  The <link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/transformer/TransformerImpl.html";>TransformerImpl</link>
 object, which implements the TrAX <link 
anchor="http://trax.openxml.org/javadoc/trax/Transformer.html";>Transformer</link>
 interface, and has an association with a <link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/templates/StylesheetRoot.html";>StylesheetRoot</link>
 object, begins the processing of the source tree (or provides a <link 
anchor="http://www.megginson.com/SAX/Java/javadoc/org/xml/sax/ContentHandler.html";>ContentHandler</link>
 reference), and performs the transformation.  The Transformer package does as 
much of the transformation as it can, but element level operations are 
generally performed in the <link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/temp
lates/ElemTemplateElement.html#execute(org.apache.xalan.transformer.TransformerImpl,
 org.w3c.dom.Node, 
org.apache.xalan.utils.QName)">ElemTemplateElement.execute(...)</link> 
methods.</p><p>Result Tree events are fed into a <link 
anchor="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/transformer/ResultTreeHandler.html";>ResultTreeHandler</link>
 object, which acts as a layer between the direct calls to the result 
  +      <p><link>Transformer Module</link></p> 
  +      <p>The <jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/transformer/package-summary.html";>Transformer</jump>
 module is in charge of run-time transformations.  The <jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/transformer/TransformerImpl.html";>TransformerImpl</jump>
 object, which implements the TrAX <jump 
href="http://trax.openxml.org/javadoc/trax/Transformer.html";>Transformer</jump> 
interface, and has an association with a <jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/templates/StylesheetRoot.html";>StylesheetRoot</jump>
 object, begins the processing of the source tree (or provides a <jump 
href="http://www.megginson.com/SAX/Java/javadoc/org/xml/sax/ContentHandler.html";>ContentHandler</jump>
 reference), and performs the transformation.  The Transformer package does as 
much of the transformation as it can, but element level operations are 
generally performed in the <jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/templates/ElemTe
mplateElement.html#execute(org.apache.xalan.transformer.TransformerImpl, 
org.w3c.dom.Node, 
org.apache.xalan.utils.QName)">ElemTemplateElement.execute(...)</jump> 
methods.</p><p>Result Tree events are fed into a <jump 
href="http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/transformer/ResultTreeHandler.html";>ResultTreeHandler</jump>
 object, which acts as a layer between the direct calls to the result 
   tree content handler (often a Serializer), and the Transformer.  For one 
thing, 
    we have to delay the call to
    startElement(name, atts) because of the
  @@ -400,8 +414,8 @@
    the node count is based on its position in the cache list.  The 
CountersTable class is a table of counters, keyed by ElemNumber objects, each 
    of which has a list of Counter 
objects.</item></gloss><gloss><label>KeyIterator, KeyManager, and 
KeyTable</label><item>These classes handle mapping of keys declared with the 
xsl:key element.</item></gloss><gloss><label>TransformState</label><item>This 
interface is meant to be used by a consumer of SAX2 events produced by Xalan, 
and enables the consumer 
    to get information about the state of the transform.  It 
  - is primarily intended as a tooling interface.</item></gloss><p>Even though 
the following modules are defined in the org.apache.xalan package, instead of 
the transformer package, they are defined in this section as they are mostly 
related to runtime transformation.</p> 
  -  <s3 title="Stree Module"><p><link idref="stree">Stree Module [And 
discussions about streaming]</link></p><p>The Stree module implements the 
default <link anchor="http://www.w3.org/TR/xpath#data-model";>Source Tree 
</link> for Xalan, that is to be transformed.  It implements read-only <link 
anchor="http://www.w3.org/TR/DOM-Level-2/";>DOM2</link> interfaces, and provides 
some information needed for fast transforms, such as document order indexes.  
It also attempts to allow a streaming transform by launching the transform on a 
secondary thread as soon as the SAX2 <link 
anchor="http://www.megginson.com/SAX/Java/javadoc/org/xml/sax/ContentHandler.html#startDocument()">StartDocument</link>
 event has occurred.  When the transform requests a node, and node is not 
present, the getFirstChild and GetNextSibling methods will wait until the child 
node has arrived, or an <link 
anchor="http://www.megginson.com/SAX/Java/javadoc/org/xml/sax/ContentHandler.html#endElement(java.lang.String,%20java.lang.String,%20java.lang.S
tring)">endElement</link> event has occurred.</p><p>Note that the secondary 
thread is an issue.  It would be better to do the same thing as described above 
on a single thread, but using the parser in 'pull' mode, or simply with a 
parseNext method so the parse would occur in blocks.</p><p>This kind of 
streaming is not perfect because it still requires an entire source tree to be 
concretely built.  There have been a lot of good discussions on the xalan-dev 
list about how to do static analysis of a stylesheet, and be able to allocate 
only the nodes needed by the transform, while they are needed (or not allocate 
source objects at all).</p><p>Vincent-Olivier Arsenault &lt;[EMAIL 
PROTECTED]&gt; has proposed the following design:</p><p>By looking at the 
stylesheet you know how streamable it is (of course this
  + is primarily intended as a tooling interface.</item></gloss><p>Even though 
the following modules are defined in the org.apache.xalan package, instead of 
the transformer package, they are defined in this section as they are mostly 
related to runtime transformation.</p><anchor name="stree"/>
  +  <s3 title="Stree Module"><p><link>Stree Module [And discussions about 
streaming]</link></p><p>The Stree module implements the default <jump 
href="http://www.w3.org/TR/xpath#data-model";>Source Tree </jump> for Xalan, 
that is to be transformed.  It implements read-only <jump 
href="http://www.w3.org/TR/DOM-Level-2/";>DOM2</jump> interfaces, and provides 
some information needed for fast transforms, such as document order indexes.  
It also attempts to allow a streaming transform by launching the transform on a 
secondary thread as soon as the SAX2 <jump 
href="http://www.megginson.com/SAX/Java/javadoc/org/xml/sax/ContentHandler.html#startDocument()">StartDocument</jump>
 event has occurred.  When the transform requests a node, and node is not 
present, the getFirstChild and GetNextSibling methods will wait until the child 
node has arrived, or an <jump 
href="http://www.megginson.com/SAX/Java/javadoc/org/xml/sax/ContentHandler.html#endElement(java.lang.String,%20java.lang.String,%20java.lang.String)">endElement</ju
mp> event has occurred.</p><p>Note that the secondary thread is an issue.  It 
would be better to do the same thing as described above on a single thread, but 
using the parser in 'pull' mode, or simply with a parseNext method so the parse 
would occur in blocks.</p><p>This kind of streaming is not perfect because it 
still requires an entire source tree to be concretely built.  There have been a 
lot of good discussions on the xalan-dev list about how to do static analysis 
of a stylesheet, and be able to allocate only the nodes needed by the 
transform, while they are needed (or not allocate source objects at 
all).</p><p>Vincent-Olivier Arsenault &lt;[EMAIL PROTECTED]&gt; has proposed 
the following design:</p><p>By looking at the stylesheet you know how 
streamable it is (of course this
   needs strict adherence to the xslt recommendation). since there's a root
   template and no &lt;xsl:apply-templates/&gt; you can build your context list
   containing only absolute xpath which means nodes get out of context
  @@ -440,37 +454,37 @@
   
   <li>the streaming context xpath (triggers streaming of the buffer to the
   output).</li>
  -</ol>
  -</s3><s3 title="Extensions Module"><p><link idref="extensions">Extensions 
Module</link></p><p>This package contains an implementation of Xalan Extension 
Mechanism, which uses the <link 
anchor="http://oss.software.ibm.com/developerworks/opensource/bsf/";>Bean 
Scripting Framework</link>.
  +</ol><anchor name="extensions"/>
  +</s3><s3 title="Extensions Module"><p><link>Extensions 
Module</link></p><p>This package contains an implementation of Xalan Extension 
Mechanism, which uses the <jump 
href="http://oss.software.ibm.com/developerworks/opensource/bsf/";>Bean 
Scripting Framework</jump>.
   
  -The Bean Scripting Framework (BSF) is an architecture for incorporating 
scripting into Java applications and applets.  Scripting languages such as 
Netscape Rhino (Javascript), VBScript, Perl, Tcl, Python, NetRexx and Rexx can 
be used to augment XSLT's functionality.  In addition, the Xalan extension 
mechanism allows use of Java classes.  See the <link 
anchor="http://xml.apache.org/xalan/extensions.html";>Xalan-J 1 extension 
documentation</link> for a description of using extensions in a stylesheet. 
Please note that the W3C XSL Working Group is working on a specification for 
standard extension bindings, and this module will change to follow that 
specification.  </p><p>[More needed... -sb]</p></s3></s2><anchor name="xpath"/> 
  +The Bean Scripting Framework (BSF) is an architecture for incorporating 
scripting into Java applications and applets.  Scripting languages such as 
Netscape Rhino (Javascript), VBScript, Perl, Tcl, Python, NetRexx and Rexx can 
be used to augment XSLT's functionality.  In addition, the Xalan extension 
mechanism allows use of Java classes.  See the <jump 
href="http://xml.apache.org/xalan/extensions.html";>Xalan-J 1 extension 
documentation</jump> for a description of using extensions in a stylesheet. 
Please note that the W3C XSL Working Group is working on a specification for 
standard extension bindings, and this module will change to follow that 
specification.  </p><p>[More needed... -sb]</p></s3></s2><anchor name="xpath"/> 
     <s2 title="XPath Module"> 
  -      <p><link idref="xpath">XPath Module</link></p> 
  +      <p><link>XPath Module</link></p> 
         <p>This module is pulled out of the Xalan package, and put in the 
org.apache package, to emphasize that the intention is that this package can be 
used independently of the XSLT engine, even though it has dependencies on the 
Xalan utils module.</p><p><img src="org_apache.gif" alt="xalan ---> 
xpath"/></p> 
     <p>The XPath module first compiles the XPath strings into expression 
trees, and then executes these expressions via a call to the XPath execute(...) 
function.  </p>  <p>Major classes 
are:</p><gloss><label>XPath</label><item>Represents a compiled XPath.  Major 
function is <code>XObject execute(XPathContext xctxt, Node contextNode, 
                            PrefixResolver 
namespaceContext).</code></item></gloss><gloss><label>XPathAPI</label><item>The 
methods in this class are convenience methods into the
    low-level XPath 
API.</item></gloss><gloss><label>XPathContext</label><item>Used as the runtime 
execution context for 
XPath.</item></gloss><gloss><label>DOMHelper</label><item>Used as a helper for 
handling DOM issues.  May be subclassed to take advantage 
      of specific DOM 
implementations.</item></gloss><gloss><label>SourceTreeManager</label><item>bottlenecks
 all management of source trees.  The methods
    in this class should allow easy garbage collection of source 
  - trees, and should centralize parsing for those source 
trees.</item></gloss><gloss><label>Expression</label><item>The base-class of 
all expression objects, allowing polymorphic behaviors.</item></gloss><p>The 
general architecture of the XPath module is divided into the compiler, and 
categories of expression objects.</p><p><img src="xpath.gif" alt="xpath 
modules"/></p><p>The most important module is the axes module.  This module 
implements the DOM2 <link 
anchor="http://www.w3.org/TR/DOM-Level-2/traversal.html#Iterator-overview";>NodeIterator</link>
 interface, and is meant to allow XPath clients to either override the default 
behavior or to replace this behavior.</p><p>The LocPathIterator and 
UnionPathIterator classes implement the <link 
anchor="http://www.w3.org/TR/DOM-Level-2/java-binding.html#org.w3c.dom.traversal.NodeIterator";>NodeIterator</link>
 interface, and polymorphically use AxesWalker derived objects to execute each 
step in the path.  The whole trick is to execute the LocationPath in 
depth-first d
ocument order so that nodes can be found without necessarily looking ahead or 
performing a breadth-first search.</p><s3 title="XPath Database 
Connection"><p><link idref="xpath-database">XPath Direct Database 
Connections</link></p><p>An important part of the XPath design in both Xalan 1 
and Xalan 2, is to enable database connections to be used as drivers directly 
to the XPath <link 
anchor="http://www.w3.org/TR/xpath#location-paths";>LocationPath</link> 
handling.  This allows databases to be directly connected to the transform, and 
be able to take advantage of internal indexing and the like.  While in Xalan 1 
this was done via the <link 
anchor="http://xml.apache.org/xalan/apidocs/org/apache/xalan/xpath/XLocator.html";>XLocator</link>
 interface, in Xalan 2 this interface is no longer used, and has been replaced 
by the DOM2 <link 
anchor="http://www.w3.org/TR/DOM-Level-2/traversal.html#Iterator-overview";>NodeIterator</link>
 interface.  An application or extension should be able to install their own 
NodeIterator for
 a given document.</p><p><img src="data.gif" alt="data.gif"/></p><p>[More to 
do]</p></s3></s2> 
  + trees, and should centralize parsing for those source 
trees.</item></gloss><gloss><label>Expression</label><item>The base-class of 
all expression objects, allowing polymorphic behaviors.</item></gloss><p>The 
general architecture of the XPath module is divided into the compiler, and 
categories of expression objects.</p><p><img src="xpath.gif" alt="xpath 
modules"/></p><p>The most important module is the axes module.  This module 
implements the DOM2 <jump 
href="http://www.w3.org/TR/DOM-Level-2/traversal.html#Iterator-overview";>NodeIterator</jump>
 interface, and is meant to allow XPath clients to either override the default 
behavior or to replace this behavior.</p><p>The LocPathIterator and 
UnionPathIterator classes implement the <jump 
href="http://www.w3.org/TR/DOM-Level-2/java-binding.html#org.w3c.dom.traversal.NodeIterator";>NodeIterator</jump>
 interface, and polymorphically use AxesWalker derived objects to execute each 
step in the path.  The whole trick is to execute the LocationPath in 
depth-first docum
ent order so that nodes can be found without necessarily looking ahead or 
performing a breadth-first search.</p><anchor name="xpathdbconn"/><s3 
title="XPath Database Connection"><p><link>XPath Direct Database 
Connections</link></p><p>An important part of the XPath design in both Xalan 1 
and Xalan 2, is to enable database connections to be used as drivers directly 
to the XPath <jump 
href="http://www.w3.org/TR/xpath#location-paths";>LocationPath</jump> handling.  
This allows databases to be directly connected to the transform, and be able to 
take advantage of internal indexing and the like.  While in Xalan 1 this was 
done via the <jump 
href="http://xml.apache.org/xalan/apidocs/org/apache/xalan/xpath/XLocator.html";>XLocator</jump>
 interface, in Xalan 2 this interface is no longer used, and has been replaced 
by the DOM2 <jump 
href="http://www.w3.org/TR/DOM-Level-2/traversal.html#Iterator-overview";>NodeIterator</jump>
 interface.  An application or extension should be able to install their own 
NodeIterator for a gi
ven document.</p><p><img src="data.gif" alt="data.gif"/></p><p>[More to 
do]</p></s3></s2><anchor name="utils"/> 
     <s2 title="Utils Package"> 
  -      <p><link idref="utils">Utils Package</link></p> 
  +      <p><link>Utils Package</link></p> 
     <p>This package contains general utilities for use by both the xalan and 
xpath packages.  It is the intention that many of these utility classes (or 
their equivalents) be eventually brought into the org.apache.xml package for 
general use.  The list of major utilities are as 
follows:</p><gloss><label>AttList</label><item>Wraps a DOM attribute list in a 
SAX Attributes.</item></gloss><gloss><label>BoolStack, IntStack, IntVector, 
etc.</label><item>Simple stacks and vectors  for primitive 
values.</item></gloss><gloss><label>DefaultErrorHandler</label><item>Implements 
SAX error handler for default 
reporting.</item></gloss><gloss><label>DOMBuilder</label><item>Takes SAX events 
(in addition to some extra events 
    that SAX doesn't handle yet) and adds the result to a document 
    or document fragment.</item></gloss><gloss><label>Heap</label><item>Classic 
heap 
implementation.</item></gloss><gloss><label>MutableAttrListImpl</label><item>Mutable
 version of 
AttributesImpl.</item></gloss><gloss><label>NameSpace</label><item>A 
representation of a 
namespace.</item></gloss><gloss><label>NodeVector</label><item>A very simple 
table that stores a list of 
Nodes.</item></gloss><gloss><label>ObjectPool</label><item>Used for reuse of 
objects.</item></gloss><gloss><label>PrefixResolver</label><item>The class that 
implements this interface can resolve prefixes 
    to 
namespaces.</item></gloss><gloss><label>PrefixResolverDefault</label><item>This 
class implements a generic PrefixResolver for a DOM, that 
    can be used to perform prefix-to-namespace lookup 
  - for an XPath.</item></gloss><gloss><label>QName</label><item>Class to 
represent a  qualified XML 
name.</item></gloss><gloss><label>StringToStringTable</label><item>A very 
simple lookup table that stores a list of strings for lookup.  Used when a 
hashtable is too much 
overhead.</item></gloss><gloss><label>SystemIDResolver</label><item>Able to 
take a SystemID string and try and turn it into a good absolute 
URL.</item></gloss><gloss><label>TreeWalker</label><item>Implements a Visitor 
design pattern, doing a pre-order walk of the DOM tree, calling a 
ContentHandler interface as it goes.  Used for DOM-to-SAX 
conversion.</item></gloss><gloss><label>Trie</label><item>A digital search trie 
for 7-bit ASCII text.</item></gloss><gloss><label>UnImplNode</label><item>To be 
subclassed by classes that wish to act as DOM nodes, without having to 
implement all the methods.  Widely used.</item></gloss></s2> 
  + for an XPath.</item></gloss><gloss><label>QName</label><item>Class to 
represent a  qualified XML 
name.</item></gloss><gloss><label>StringToStringTable</label><item>A very 
simple lookup table that stores a list of strings for lookup.  Used when a 
hashtable is too much 
overhead.</item></gloss><gloss><label>SystemIDResolver</label><item>Able to 
take a SystemID string and try and turn it into a good absolute 
URL.</item></gloss><gloss><label>TreeWalker</label><item>Implements a Visitor 
design pattern, doing a pre-order walk of the DOM tree, calling a 
ContentHandler interface as it goes.  Used for DOM-to-SAX 
conversion.</item></gloss><gloss><label>Trie</label><item>A digital search trie 
for 7-bit ASCII text.</item></gloss><gloss><label>UnImplNode</label><item>To be 
subclassed by classes that wish to act as DOM nodes, without having to 
implement all the methods.  Widely used.</item></gloss></s2><anchor 
name="other"/>
     <s2 title="Other Packages"> 
  -      <p><link idref="other">Other Packages</link></p> 
  +      <p><link>Other Packages</link></p> 
         <gloss><label>client</label><item>Implementation of Xalan Applet 
[should we keep this?].
   
   </item></gloss> 
                <gloss><label>dtm</label><item>Implementation of the Document 
Table Model (DTM) [Should we keep this?].</item></gloss> 
                <gloss><label>extensions</label><item>Implementation of Xalan 
Extension Mechanism, which uses the Bean Scripting Framework.</item></gloss> 
  -             <gloss><label>lib</label><item>Implementation of Xalan-specific 
extensions [I want to add lots more extensions to this 
package!].</item></gloss><gloss><label>res</label><item>Contains strings that 
require internationalization.</item></gloss></s2> 
  +             <gloss><label>lib</label><item>Implementation of Xalan-specific 
extensions [I want to add lots more extensions to this 
package!].</item></gloss><gloss><label>res</label><item>Contains strings that 
require internationalization.</item></gloss></s2><anchor name="coding"/> 
     <s2 title="Coding Conventions"> 
  -      <p><link idref="coding-conventions">Coding Conventions</link></p> 
  +      <p><link>Coding Conventions</link></p> 
         <p>This section documents the coding conventions used in the Xalan
                source.</p> 
         <ol> 
  @@ -489,9 +503,9 @@
                <li>Package-scoped member variables, public member variables, 
and
                  protected member variables should not be declared.</li> 
         </ol> 
  -  </s2> 
  +  </s2><anchor name="open"/> 
     <s2 title="Open Issues"> 
  -      <p><link idref="open-issues">Open Issues</link></p> 
  +      <p><link>Open Issues</link></p> 
         <p>This section documents architectural and design issues that I still
                consider to be open or unsolved. (This list is ongoing, and 
will change over
                time... it's simply a place for me to note problems that are 
ongoing and need
  
  
  

Reply via email to