com.jclark.xsl.sax
Class XMLProcessorImpl

java.lang.Object
  extended by com.jclark.xsl.sax.XMLProcessorImpl
All Implemented Interfaces:
XMLProcessorEx, XMLProcessor

public class XMLProcessorImpl
extends java.lang.Object
implements XMLProcessorEx

parses a source doc or stylesheet into our own DOM like structure


Nested Class Summary
(package private) static interface XMLProcessorImpl.Builder
           
 
Constructor Summary
XMLProcessorImpl(org.xml.sax.Parser parser)
          construct with a SAX1 parser we may wish to re-use for resolving e.g xsl:include
 
Method Summary
 Result createResult(Node baseNode, int documentIndex, LoadContext loadContext, Node[] rootNode)
           
 Node load(org.xml.sax.InputSource source, int documentIndex, LoadContext context, NameTable nameTable)
          parse the xml stream at source building an object model of all its nodes
 Node load(java.net.URL url, int documentIndex, LoadContext context, NameTable nameTable)
          construct an object model from the XML source at the given URL.
 void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLProcessorImpl

public XMLProcessorImpl(org.xml.sax.Parser parser)
construct with a SAX1 parser we may wish to re-use for resolving e.g xsl:include

Method Detail

setErrorHandler

public void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
Specified by:
setErrorHandler in interface XMLProcessorEx

load

public Node load(org.xml.sax.InputSource source,
                 int documentIndex,
                 LoadContext context,
                 NameTable nameTable)
          throws java.io.IOException,
                 XSLException
parse the xml stream at source building an object model of all its nodes

Specified by:
load in interface XMLProcessorEx
Parameters:
source - the input to our parser
documentIndex - so we can distinguish between nodes in different docs
context - ??
nameTable - we intern names to avoid wasting menmory
Returns:
the document root
Throws:
java.io.IOException
XSLException

load

public Node load(java.net.URL url,
                 int documentIndex,
                 LoadContext context,
                 NameTable nameTable)
          throws java.io.IOException,
                 XSLException
Description copied from interface: XMLProcessor
construct an object model from the XML source at the given URL.

Specified by:
load in interface XMLProcessor
Parameters:
url - the source XML
documentIndex - an internal identifier for this document
nameTable - initial set of in-scope namespace bindings
Returns:
the document root
Throws:
java.io.IOException
XSLException

createResult

public Result createResult(Node baseNode,
                           int documentIndex,
                           LoadContext loadContext,
                           Node[] rootNode)
                    throws XSLException
Specified by:
createResult in interface XMLProcessor
Throws:
XSLException