com.novell.xsl.result
Class DOMResultHandler

java.lang.Object
  extended bycom.novell.xsl.result.DOMResultHandler
All Implemented Interfaces:
DOMResult, ResultHandler
Direct Known Subclasses:
FragmentHandler

public class DOMResultHandler
extends Object
implements ResultHandler, DOMResult

A result handler that builds a DOM Level 1 result tree.


Field Summary
protected  Node currentNode
          The node being built; either the document node or an element node.
 
Constructor Summary
DOMResultHandler(Document document)
          Constructs a new DOM result handler that builds the specified document node.
 
Method Summary
 void attribute(String name, String value)
          Receive notification of an attribute.
 void characters(String data)
          Receive notification of character data.
 void comment(String value)
          Receive notification of a comment.
 void endDocument()
          Receive notification of the end of a document.
 void endElement(String name)
          Receive notification of the end of an element.
 Document getDocument()
          Return the Document object used for this handler
 void namespace(String name, NamespaceName value)
          Receive notification of a namespace node.
 void processingInstruction(String target, String value)
          Receive notification of a processing instruction.
 void startDocument()
          Receive notification of the beginning of a document.
 void startElement(String name, String namespaceURI)
          Receive notification of the beginning of an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentNode

protected Node currentNode
The node being built; either the document node or an element node.

Constructor Detail

DOMResultHandler

public DOMResultHandler(Document document)
Constructs a new DOM result handler that builds the specified document node. The specified document should not yet contain a document element.

Parameters:
document - the result document to be built
Method Detail

getDocument

public Document getDocument()
Return the Document object used for this handler

Specified by:
getDocument in interface DOMResult
Returns:
The Document object used for this handler

startDocument

public void startDocument()
                   throws ResultException
Description copied from interface: ResultHandler
Receive notification of the beginning of a document.

Specified by:
startDocument in interface ResultHandler
Throws:
ResultException - if an implementation-dependent error occurs

endDocument

public void endDocument()
                 throws ResultException
Description copied from interface: ResultHandler
Receive notification of the end of a document.

Specified by:
endDocument in interface ResultHandler
Throws:
ResultException - if an implementation-dependent error occurs

startElement

public void startElement(String name,
                         String namespaceURI)
                  throws IllegalNameException,
                         IllegalNodeException,
                         ResultException
Description copied from interface: ResultHandler
Receive notification of the beginning of an element.

Specified by:
startElement in interface ResultHandler
Parameters:
name - the element's name
namespaceURI - the element's namespace uri
Throws:
IllegalNameException - if the specified element name is illegal
IllegalNodeException - if the current node cannot contain elements
ResultException - if an implementation-dependent error occurs

endElement

public void endElement(String name)
                throws ResultException
Description copied from interface: ResultHandler
Receive notification of the end of an element.

Specified by:
endElement in interface ResultHandler
Throws:
ResultException - if an implementation-dependent error occurs

attribute

public void attribute(String name,
                      String value)
               throws AttributeAfterChildException,
                      IllegalNameException,
                      IllegalNodeException,
                      ResultException
Description copied from interface: ResultHandler
Receive notification of an attribute.

Specified by:
attribute in interface ResultHandler
Parameters:
name - the attribute's name
value - the attribute's value
Throws:
IllegalNodeException - if the current node is not an element
AttributeAfterChildException - if the current node is an element with children (attributes cannot be added to an element after children have been added to it)
IllegalNameException - if the specified attribute name is illegal
ResultException - if an implementation-dependent error occurs

characters

public void characters(String data)
                throws IllegalNodeException,
                       ResultException
Description copied from interface: ResultHandler
Receive notification of character data.

Specified by:
characters in interface ResultHandler
Parameters:
data - the character data
Throws:
ResultException - if an implementation-dependent error occurs
IllegalNodeException - if the current node cannot contain character data

processingInstruction

public void processingInstruction(String target,
                                  String value)
                           throws IllegalNameException,
                                  IllegalNodeException,
                                  ResultException
Description copied from interface: ResultHandler
Receive notification of a processing instruction.

Specified by:
processingInstruction in interface ResultHandler
Parameters:
target - the processing instruction's target
value - the processing instruction's value, or null if there is no value
Throws:
ResultException - if an implementation-dependent error occurs
IllegalNameException - if the specified target name is illegal
IllegalNodeException - if the current node cannot contain processing instructions

comment

public void comment(String value)
             throws IllegalNodeException,
                    ResultException
Description copied from interface: ResultHandler
Receive notification of a comment.

Specified by:
comment in interface ResultHandler
Parameters:
value - the comment's value
Throws:
IllegalNodeException - if the current node cannot contain comments
ResultException - if an implementation-dependent error occurs

namespace

public void namespace(String name,
                      NamespaceName value)
               throws IllegalNodeException,
                      ResultException
Description copied from interface: ResultHandler
Receive notification of a namespace node. An implementation should keep track of what namespace attributes are in scope in the xml representation to avoid placing redundant attributes on elements.

Specified by:
namespace in interface ResultHandler
Parameters:
name - the namespace prefix
value - the namespace name (URI)
Throws:
IllegalNodeException - if the current node cannot contain namespaces
ResultException - if an implementation-dependent error occurs