Skip Headers

Oracle9i Supplied Java Packages Reference
Release 2 (9.2)

Part Number A96609-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

11
Package oracle.xml.parser.v2

This chapter describes the classes contained in package oracle.xml.parser.v2. These classes implement the XML Parser, the DOM, and the SAX APIs in the Oracle XDK for Java. (DOM is for Document Object Model, and SAX is for Simple API for XML.) The full functionality of XML Parser, DOM, and SAX APIs are contained in the oracle.xml.parser.v2 package.

This chapter contains these sections:


Package oracle.xml.parser.v2 Description

The classes contained in package oracle.xml.parser.v2 implement the APIs for the XML Parser, DOM, and SAX in the Oracle9i XDK for Java. The classes that implement the XSLT Processor for Java are also contained in the oracle.xml.parser.v2 package.

The Oracle implementations of the DOM and SAX APIs adhere to the World Wide Web Consortium (W3C) recommendations for the XML standard.

The supporting utility classes are found in package oracle.xml.util, which is documented in Chapter 10, "Package oracle.xml.util"in this manual.

See Also:

Package oracle.xml.parser.v2 Summary

The tables in this section summarize the oracle.xml.parser.v2 interfaces and classes documented in this chapter.

Table 11-1  oracle.xml.parser.v2 Package Interfaces
Interface Description

NSResolver Interface

Provides support for resolving Namespaces.

PrintDriver Interface

The PrintDriver interface defines methods used to print XML documents represented as DOM trees.

XMLToken Interface

Basic interface for XMLToken.

Table 11-2  oracle.xml.parser.v2 Package Classes
Class Description

AttrDecl

Holds information about each attribute declared in an attribute list in the Document Type Definition (DTD).

DefaultXMLDocumentHandler

Implements the default behaviour for the XMLDocumentHandler interface.

DOMParser

Implements an eXtensible Markup Language (XML) 1.0 parser according to the World Wide Web Consortium (W3C) recommendation.

DTD

Implements the DOM DocumentType interface and holds the Document Type Definition (DTD) information for an XML document.

ElementDecl

Represents an element declaration in a Document Type Definition DTD.

NodeFactory

Specifies methods to create various nodes of the DOM tree built during parsing.

oraxml

Implements the XML Decl Processing Instruction.

SAXAttrList

Implements the SAX AttributeList interface and also provides Namespace support.

SAXParser

Implements an eXtensible Markup Language (XML) 1.0 SAX parser according to the World Wide Web Consortium (W3C) recommendation.

XMLAttr

Implements the DOM Attr interface and holds information on each attribute of an element.

XMLCDATA

Implements the DOM CDATASection interface.

XMLComment

Implements the DOM Comment interface.

XMLDeclPI

Implements the XML Decl Processing Instruction.

XMLDocument

This class implements the DOM Document interface, represents an entire XML document and serves the root of the Document Object Model tree.

XMLDocumentFragment

This class implements the DOM DocumentFragment interface.

XMLDOMImplementation

Implements the DOMImplementation.

XMLElement

This class implements the DOM Element interface.

XMLEntityReference

Implements DOM EntityReference interface.

XMLNode

Implements the DOM Node interface and serves as the primary datatype for the entire Document Object Model.

XMLParser

This class serves as a base class for the DOMParser and SAXParser classes.

XMLPI

This class implements the DOM Processing Instruction interface.

XMLText

This class implements the DOM Text interface.

XMLTokenizer

This class implements an eXtensible Markup Language (XML) 1.0 parser according to the World Wide Web Consortium (W3C) recommendation.

Table 11-3  oracle.xml.parser.v2 Package Exceptions
Exception Description

XMLDOMException

Indicates an exception in DOM operation.

XMLParseException

Indicates that a parsing exception occurred while processing an XML document

XMLRangeException

Indicates an exception in DOM Range operation.

The classes listed in Table 11-4, " Summary of XSLT Processor Classes in package oracle.xml.parserv2" summarize the XSLT Processor classes contained in the oracle.xml.parser.v2 package.

Table 11-4  Summary of XSLT Processor Classes in package oracle.xml.parserv2
Class Description

oraxsl Class

Provides a command-line interface to applying stylesheets on multiple XML documents.

XPathException Class

Indicates that an exception occurred during XSL tranformation.

XSLProcessor Class

Provides methods to transform an input XML document using a previously constructed XSLStylesheet.

XSLStylesheet Class

Holds XSL stylesheet information such as templates, keys, variables, and attribute sets.


NSResolver Interface

Syntax of NSResolver

public interface NSResolver

Description of NSResolver

This interface provides support for resolving Namespaces

Known Implementing Classes of NSResolver

XMLElement


Methods

resolveNamespacePrefix(String)

Description

Find the namespace definition in scope for a given namespace prefix

Syntax

public java.lang.String resolveNamespacePrefix(java.lang.String prefix)

Parameters

prefix - Namespace prefix to be resolved

Returns

the resolved Namespace (null, if prefix could not be resolved)


PrintDriver Interface

Description of PrintDriver

The PrintDriver interface defines methods used to print XML documents represented as DOM trees.

Syntax of PrintDriver

public interface PrintDriver

Implementing Classes of PrintDriver

XMLPrintDriver


Methods

Table 11-5  Summary of Methods of PintDriver
Method Description

close()

Closes the output stream or print writer

flush()

Flushes the output stream or print writer

printAttribute( XMLAttr)

Prints a XMLAttr node

printAttributeNodes( XMLElement)

Calls print method for each attribute of the XMLElement

printCDATASection( XMLCDATA)

Prints a XMLCDATA node

printChildNodes( XMLNode)

Calls print method for each child of the XMLNode

printComment( XMLComment)

Prints a XMLComment node

printDoctype( DTD)

Prints an DTD.

printDocument( XMLDocument)

Prints an XMLDocument.

printDocumentFragment( XMLDocumentFragment)

Prints an empty XMLDocumentFragment object.

printElement( XMLElement)

Prints an XMLElement.

printEntityReference( XMLEntityReference)

Prints a XMLEntityReference node

printProcessingInstruction( XMLPI)

Prints a XMLPI node

printTextNode( XMLText)

Prints a XMLText node

setEncoding( String)

Sets the encoding of the print driver.

close()

Description

Closes the output stream or print writer

Syntax

public void close()

flush()

Description

Flushes the output stream or print writer

Syntax

public void flush()

printAttribute(XMLAttr)

Description

Prints a XMLAttr node

Syntax

public void printAttribute(XMLAttr attr)

Parameters

attr - The XMLAttr node.

printAttributeNodes(XMLElement)

Description

Calls print method for each attribute of the XMLElement

Syntax

public void printAttributeNodes(XMLElement elem)

Parameters

elem - The elem whose attributes are to be printed.

printCDATASection(XMLCDATA)

Description

Prints a XMLCDATA node

Syntax

public void printCDATASection(XMLCDATA cdata)

Parameters

cdata - The XMLCDATA node.

printChildNodes(XMLNode)

Description

Calls print method for each child of the XMLNode

Syntax

public void printChildNodes(XMLNode node)

Parameters

node - The node whose children are to be printed.

printComment(XMLComment)

Description

Prints a XMLComment node

Syntax

public void printComment(XMLComment comment)

Parameters

comment - The comment node.

printDoctype(DTD)

Description

Prints an DTD.

Syntax

public void printDoctype(DTD dtd)

Parameters

dtd - The dtd to be printed.

printDocument(XMLDocument)

Description

Prints an XMLDocument.

Syntax

public void printDocument(XMLDocument doc)

Parameters

elem - The document to be printed.

printDocumentFragment(XMLDocumentFragment)

Syntax

public void printDocumentFragment(XMLDocumentFragment dfrag)

Description

Prints an empty XMLDocumentFragment object.

Parameters

dfrag - The document fragment to be printed.

printElement(XMLElement)

Syntax

public void printElement(XMLElement elem)

Description

Prints an XMLElement.

Parameters

elem - The element to be printed.

printEntityReference(XMLEntityReference)

Description

Prints a XMLEntityReference node

Syntax

public void printEntityReference(XMLEntityReference en)

Parameters

en - The XMLEntityReference node.

printProcessingInstruction(XMLPI)

Description

Prints a XMLPI node

Syntax

public void printProcessingInstruction(XMLPI pi)

Parameters

pi - The XMLPI node.

printTextNode(XMLText)

Description

Prints a XMLText node

Syntax

public void printTextNode(XMLText text)

Parameters

text - The text node.

setEncoding(String)

Description

Sets the encoding of the print driver.

Syntax

public void setEncoding(java.lang.String enc)

Parameters

enc - The encoding of the document being printed.


NSName

Interface in package oracle.xml.util.

Description

Part of package oracle.xml.util. This interface provides Namespace support for Element and Attr names.

Syntax

public interface NSName

Methods

getExpandedName()

Description

Get the fully resolved name for this name

Syntax

public java.lang.String getExpandedName()

Returns

The fully resolved name

getLocalName()

Description

Get the local name for this name

Syntax

public java.lang.String getLocalName()

Returns

The local name

getNamespace()

Description

Get the resolved Namespace for this name

Syntax

public java.lang.String getNamespace()

Returns

The resolved Namespace

getPrefix()

Description

Get the prefix for this name

Syntax

public java.lang.String getPrefix()

Returns

The prefix

getQualifiedName()

Description

Get the qualified name

Syntax

public java.lang.String getQualifiedName()

Returns

The qualified name


AttrDecl

Description

This class hold information about each attribute declared in an attribute list in the Document Type Definition.

Syntax

public class AttrDecl implements java.io.Externalizable
 
oracle.xml.parser.v2.AttrDecl

Implemented Interfaces

java.io.Externalizable, java.io.Serializable

Fields

Table 11-6 Fields of AttrDecl
Field Syntax Description

CDATA

public static final int CDATA

AttType - StringType - CDATA

DEFAULT

public static final int DEFAULT

Attribute presence - Default

ENTITIES

public static final int ENTITIES

AttType - TokenizedType - Entities

ENTITY

public static final int ENTITY

AttType - TokenizedType - Entity

ENUMERATION

public static final int ENUMERATION

AttType - EnumeratedType - Enumeration

FIXED

public static final int FIXED

Attribute presence - Fixed

ID

public static final int ID

AttType - TokenizedType - ID

IDREF

public static final int IDREF

AttType - TokenizedType - ID reference

IDREFS

public static final int IDREFS

AttType - TokenizedType - ID references

IMPLIED

public static final int IMPLIED

Attribute presence - Implied

NMTOKEN

public static final int NMTOKEN

AttType - TokenizedType - Name token

NMTOKENS

public static final int NMTOKENS

AttType - TokenizedType - Name tokens

NOTATION

public static final int NOTATION

AttType - EnumeratedType - Notation

REQUIRED

public static final int REQUIRED

Attribute presence - Required


Constructors

AttrDecl()

Description

Default constructor. Note that this constructor is used only during deserialization/ decompression of this DOM node. In order to deserialize this node to construct the DOM node from the serialized/ compressed stream, it is required to create a handle of the object.

Syntax

public static final int REQUIRED public  AttrDecl()


Methods

Table 11-7  Summary of Methods of AttrDecl
Methods Description

getAttrPresence()

Gets attribute presence

getAttrType()

Gets attribute type

getDefaultValue

Gets attribute default value

getEnumerationValues()

Gets attribute values

getNodeName()

Gets the name of the Attr Decl

getNodeType()

Gets a code representing the type of the underlying object

getExternal(ObjectInput)

This method reads the information written in the compressed stream by writeExternal method and restores the object correspondingly

readExternal(ObjectInput)

Reads the information written in the compressed stream by writeExternal method and restores the object correspondingly.

typeToString (int)

Gets a string representation of the attribute type

writeExternal(ObjectOutput)

This method saves the state of the object by creating a binary compressed stream with information about this object.

getAttrPresence()

Description

Gets attribute presence

Syntax

public int getAttrPresence()

Returns

The presence of the attribute

getAttrType()

Description

Gets attribute type

Syntax

public int getAttrType()

Returns

The type of the attribute

getDefaultValue()

Description

Gets attribute default value

Syntax

public java.lang.String getDefaultValue()

Returns

The default value of the attribute

getEnumerationValues()

Description

Gets attribute values

Syntax

public java.util.Vector getEnumerationValues()

Returns

The values of the attribute as an Enumeration

getNodeName()

Description

Gets the name of the Attr Decl.

Syntax

public java.lang.String getNodeName()

Returns

Name of the node

getNodeType()

Description

Gets a code representing the type of the underlying object

Syntax

public short getNodeType()

Returns

type of the node

readExternal(ObjectInput)

Description

This method reads the information written in the compressed stream by writeExternal method and restores the object correspondingly.

Syntax

public void readExternal(java.io.ObjectInput inArg)

Specified By

java.io.Externalizable.readExternal(java.io.ObjectInput) in interface java.io.Externalizable

Parameters

inArg - the ObjectInput stream used for reading the compressed stream.

Throws

IOException - is thrown when there is an error in reading the input stream.

ClassNotFoundException - is thrown when the class is not found

typeToString(int)

Description

Gets a string representation of the attribute type

Syntax

public static java.lang.String typeToString(int type)

Returns

A string representing the attribute type

writeExternal(ObjectOutput)

Description

This method saves the state of the object by creating a binary compressed stream with information about this object.

Syntax

public void writeExternal(java.io.ObjectOutput outArg)

Specified By

java.io.Externalizable.writeExternal(java.io.ObjectOutput) in interface java.io.Externalizable

Parameters

outArg - The ObjectOutput stream used to write the serialized/ compressed stream.

Throws

IOException - is thrown when there is an exception while writing the serialized/compressed stream.


DefaultXMLDocumentHandler

Description of DefaultXMLDocumentHandler

This class implements the default behaviour for the XMLDocumentHandler interface.

Application writers can extend this class when they need to implement only part of the interface

Syntax of DefaultXMLDocumentHandler

public class DefaultXMLDocumentHandler implements 
oracle.xml.parser.v2.XMLDocumentHandler
 
oracle.xml.parser.v2.DefaultXMLDocumentHandler

Implemented Interfacesof DefaultXMLDocumentHandler

XMLDocumentHandler


Constructors

DefaultXMLDocumentHandler()

Description

Constructs a default document

Syntax

public  DefaultXMLDocumentHandler()

Methods

Table 11-8  Summary of Methods of DefaultXMLDocumentHandler
Methods Description

cDATASection(char[], int, int)

Receive notification of a CDATA Section. The Parser will invoke this method once for each CDATA Section found.

comment(String)

Receive notification of a comment. The Parser will invoke this method once for each comment found: note that comment may occur before or after the main document element.

endDoctype()

Receive notification of end of the DTD.

endElement(NSName)

Receive notification of the end of an element.

endElement(String, String, String)

Receive notification of the end of an element.

endPrefixMapping(String)

End the scope of a prefix-URI mapping.

getHandler()

Get the next pipe-line node handler.

setDoctype(DTD)

Receive notification of DTD. Sets the DTD.

setError(XMLError)

Receive notification of a XMLError handler.

setHandler(XMLDocumentHandler)

Receive notification of a next pipe-line node handler.

setTextDecl(String, String)

Receive notification of a Text XML Declaration. The Parser will invoke this method once for each text XML Decl

setXMLDecl(String, String, String)

Receive notification of an XML Declaration. The Parser will invoke this method once for XML Decl.

setXMLSchema(Object)

Receive notification of a XMLSchema object.

skippedEntity(String)

Receive notification of a skipped entity.

startElement(NSName, SAXAttrList)

Receive notification of the beginning of an element.

startElement(String, String, String, Attributes)

Receive notification of the beginning of an element.

startPrefixMapping(String, String)

Begin the scope of a prefix-URI Namespace mapping.

cDATASection(char[], int, int)

Description

Receive notification of a CDATA Section. The Parser will invoke this method once for each CDATA Section found.

Syntax

public void cDATASection(char[] ch, int start, int length)

Specified By

XMLDocumentHandler.cDATASection(char[], int, int) in interface XMLDocumentHandler

Parameters

ch - The CDATA section characters.

start - The start position in the character array.

length - The number of characters to use from the character array.

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

comment(String)

Description

Receive notification of a comment. The Parser will invoke this method once for each comment found: note that comment may occur before or after the main document element.

Syntax

public void comment(java.lang.String data)

Specified By

XMLDocumentHandler.comment(String) in interface XMLDocumentHandler

Parameters

data - The comment data, or null if none was supplied.

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

endDoctype()

Description

Receive notification of end of the DTD.

Syntax

public void endDoctype()

Specified By

XMLDocumentHandler.endDoctype() in interface XMLDocumentHandler

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

endElement(NSName)

Description

Receive notification of the end of an element.

Syntax

public void endElement(NSName elem)

Specified By

XMLDocumentHandler.endElement(NSName) in interface XMLDocumentHandler

Parameters

elem - NSName object

Throws

SAXException - A SAXException could be thrown.

See Also

org.xml.sax.DocumentHandler#endElement

endElement(String, String, String)

Description

Receive notification of the end of an element.

Syntax

public void endElement(java.lang.String namespaceURI, java.lang.String 
localName, java.lang.String qName)

Parameters

uri - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.

qName - The qualified XML 1.0 name (with prefix), or the empty string if qualified names are not available.

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

endPrefixMapping(String)

Description

End the scope of a prefix-URI mapping.

Syntax

public void endPrefixMapping(java.lang.String prefix)

Parameters

prefix - The prefix that was being mapping.

Throws

org.xml.sax.SAXException - The client may throw an exception during processing.

See Also

startPrefixMapping(String, String), endElement(NSName)

getHandler()

Description

Get the next pipe-line node handler.

Syntax

public XMLDocumentHandler getHandler()

Specified By

XMLDocumentHandler.getHandler() in interface XMLDocumentHandler

Returns

The XMLDocumentHandler node

setDoctype(DTD)

Description

Receive notification of DTD. Sets the DTD.

Syntax

public void setDoctype(DTD dtd)

Specified By

XMLDocumentHandler.setDoctype(DTD) in interface XMLDocumentHandler

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

setError(XMLError)

Description

Receive notification of a XMLError handler.

Syntax

public void setError(XMLError he)

Specified By

XMLDocumentHandler.setError(XMLError) in interface XMLDocumentHandler

Parameters

err - The XMLError object

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

setHandler(XMLDocumentHandler)

Description

Receive notification of a next pipe-line node handler.

Syntax

public void setHandler(XMLDocumentHandler h)

Specified By

XMLDocumentHandler.setHandler(XMLDocumentHandler) in interface XMLDocumentHandler

h - The XMLDocumentHandler node

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

setTextDecl(String, String)

Description

Receive notification of a Text XML Declaration. The Parser will invoke this method once for each text XML Decl

Syntax

public void setTextDecl(java.lang.String version, java.lang.String encoding)

Specified By

XMLDocumentHandler.setTextDecl(String, String) in interface XMLDocumentHandler

Parameters

version - The version number (or null, if not specified)

encoding - The encoding name

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

setXMLDecl(String, String, String)

Description

Receive notification of an XML Declaration. The Parser will invoke this method once for XML Decl.

Syntax

public void setXMLDecl(java.lang.String version, java.lang.String standalone, 
java.lang.String encoding)

Specified By

XMLDocumentHandler.setXMLDecl(String, String, String) in interface XMLDocumentHandler

Parameters

version - The version number

standalone - The standalone value (or null, if not specifed)

encoding - The encoding name (or null, if not specifed)

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

setXMLSchema(Object)

Description

Receive notification of a XMLSchema object.

Syntax

public void setXMLSchema(java.lang.Object s)

Specified By

XMLDocumentHandler.setXMLSchema(Object) in interface XMLDocumentHandler

Parameters

s - The XMLSchema object

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

skippedEntity(String)

Description

Receive notification of a skipped entity.

Syntax

public void skippedEntity(java.lang.String name)

Parameters

name - The name of the skipped entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be the string "[dtd]".

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

startElement(NSName, SAXAttrList)

Description

Receive notification of the beginning of an element.

Syntax

public void startElement(NSName elem, SAXAttrList attrlist)

Specified By

XMLDocumentHandler.startElement(NSName, SAXAttrList) in interface XMLDocumentHandler

Parameters

elem - NSName object

attrlist - SAXAttrList for the element

Throws

SAXException - A SAXException could be thrown.

See Also

org.xml.sax.DocumentHandler#startElement

startElement(String, String, String, Attributes)

Description

Receive notification of the beginning of an element.

Syntax

public void startElement(java.lang.String namespaceURI, java.lang.String 
localName, java.lang.String qName, org.xml.sax.Attributes atts)

Parameters

uri - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.

qName - The qualified name (with prefix), or the empty string if qualified names are not available.

atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

See Also

endElement(NSName), org.xml.sax.Attributes

startPrefixMapping(String, String)

Description

Begin the scope of a prefix-URI Namespace mapping.

Syntax

public void startPrefixMapping(java.lang.String prefix, java.lang.String uri)

Parameters

prefix - The Namespace prefix being declared.

uri - The Namespace URI the prefix is mapped to.

Throws

org.xml.sax.SAXException - The client may throw an exception during processing.

See Also

endPrefixMapping(String), startElement(NSName, SAXAttrList)


DocumentBuilder

Syntax of DocumentBuilder

public class DocumentBuilder
 
oracle.xml.parser.v2.DocumentBuilder

Description of DocumentBuilder

This class implements XMLDocumentHandler (deprecated) and ContentHandler to build a DOM Tree from SAX 2.0 events. XMLDocumentHandler events are supported for backward compatibilty


Constructors

DocumentBuilder()

Description

Default Constructor. Creates a document builder that can be used as XMLDocumentHandler

Syntax

public  DocumentBuilder()

Methods

Table 11-9  Summary of Methods of DocumentBuilder
Methods Description

attributeDecl(String, String, String, String, String)

Report an attribute type declaration.

cDATASection(char[], int, int)

Receive notification of CDATA Section data inside an element.

characters(char[], int, int)

Receive notification of character data inside an element.

comment(char[], int, int)

Report an XML comment anywhere in the document.

comment(String)

Receive notification of a comment.

elementDecl(String, String)

Report an element type declaration.

endCDATA()

Report the end of a CDATA section.

endDoctype()

Receive notification of end of the DTD.

endDocument()

Receive notification of the end of the document.

endDTD()

Report the end of DTD declarations.

endElement(NSName)

Receive notification of the end of an element.

endElement(Sring, String, String)

Receive notification of the end of an element.

endEntity(String)

Report the end of an entity.

externalEntityDecl(String, String, String)

Report a parsed external entity declaration.

getCurrentNode()

Get the current node being build

getDocument()

Get the document being build

ignorableWhitespace(char[], int, int)

Receive notification of ignorable whitespace in element content.

internalEntityDecl(String, String)

Report an internal entity declaration

processingInstruction(String, String)

Receive notification of a processing instruction.

retainCDATASection(boolean)

Sets a flag to retain CDATA sections

setDebugMode(boolean)

Sets a flag to turn on debug information in the document

setDoctype(DTD)

Receive notification of DTD Sets the DTD

setDocumentLocator(Locator)

Receive a Locator object for document events. By default, do nothing. Application writers may override this method in a subclass if they wish to store the locator for use with other document events.

setNodeFactory(NodeFactory)

Set a optional NodeFactory to be used for creating custom DOM trees

setTextDecl(String, String)

Receive notification of a Text XML Declaration. The Parser will invoke this method once for each text XML Decl.

setXMLDecl(String, String, String)

Receive notification of a XML Declaration. The Parser will invoke this method once for XML Decl .

startCDATA()

Report the start of a CDATA section.

startDocument()

Receive notification of the beginning of the document.

startDTD(String, String, String)

Report the start of DTD declarations, if any.

startElement(NSName, SAXAttrList)

Receive notification of the beginning of an element.

startElement(String, String, String, Attributes)

Receive notification of the beginning of an element.

startEntity(String)

Report the beginning of some internal and external XML entities. All start/endEntity events must be properly nested.

attributeDecl(String, String, String, String, String)

Description

Report an attribute type declaration.

Syntax

public void attributeDecl(java.lang.String eName, java.lang.String aName, 
java.lang.String type, java.lang.String valueDefault, java.lang.String value)

Parameters

eName - The name of the associated element.

aName - The name of the attribute.

type - A string representing the attribute type.

valueDefault - A string representing the attribute default ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if none of these applies.

value - A string representing the attribute's default value, or null if there is none.

Throws

SAXException - The application may raise an exception.

cDATASection(char[ ], int, int)

Description

Receive notification of CDATA Section data inside an element.

Syntax

public void cDATASection(char[] ch, int start, int length)

Parameters

ch - The CDATA characters.

start - The start position in the character array.

length - The number of characters to use from the character array.

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

See Also

org.xml.sax.DocumentHandler#characters

characters(char[], int, int)

Description

Receive notification of character data inside an element.

Syntax

public void characters(char[] ch, int start, int length)

Parameters

ch - The characters.

start - The start position in the character array.

length - The number of characters to use from the character array.

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

See Also

org.xml.sax.DocumentHandler#characters

comment(char[], int, int)

Description

Report an XML comment anywhere in the document.

Syntax

public void comment(char[] ch, int start, int length)

Parameters

ch - An array holding the characters in the comment.

start - The starting position in the array.

length - The number of characters to use from the array.

Throws

SAXException - The application may raise an exception.

comment(String)

Description

Receive notification of a comment.

Syntax

public void comment(java.lang.String data)

Parameters

data - The comment data, or null if none was supplied.

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

elementDecl(String, String)

Description

Report an element type declaration.

Syntax

public void elementDecl(java.lang.String name, java.lang.String model)

Parameters

name - The element type name.

model - The content model as a normalized string.

Throws

SAXException - The application may raise an exception.

endCDATA()

Description

Report the end of a CDATA section.

Syntax

public void endCDATA()

Throws

SAXException - The application may raise an exception.

See Also

startCDATA()

endDoctype()

Description

Receive notification of end of the DTD.

Syntax

public void endDoctype()

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

endDocument()

Description

Receive notification of the end of the document.

Syntax

public void endDocument()

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

See Also

org.xml.sax.DocumentHandler#endDocument

endDTD()

Description

Report the end of DTD declarations.

Syntax

public void endDTD()

Throws

SAXException - The application may raise an exception.

See Also

startDTD(String, String, String)

endElement(NSName)

Description

Receive notification of the end of an element.

Syntax

public void endElement(NSName elem)

Parameters

elem - NSName object

Throws

SAXException - A SAXException could be thrown.

See Also

org.xml.sax.DocumentHandler#endElement

endElement(String, String, String)

Description

Receive notification of the end of an element.

Syntax

public void endElement(java.lang.String namespaceURI, java.lang.String 
localName, java.lang.String qName)

Parameters

namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.

qName - The qualified XML 1.0 name (with prefix), or the empty string if qualified names are not available.

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

endEntity(String)

Description

Report the end of an entity.

Syntax

public void endEntity(java.lang.String name)

Parameters

name - The name of the entity that is ending.

Throws

SAXException - The application may raise an exception.

See Also

startEntity(String)

externalEntityDecl(String, String, String)

Description

Report a parsed external entity declaration.

Syntax

public void externalEntityDecl(java.lang.String name, java.lang.String publicId, 
java.lang.String systemId)

Parameters

name - The name of the entity. If it is a parameter entity, the name will begin with '%'.

publicId - The declared public identifier of the entity, or null if none was declared.

systemId - The declared system identifier of the entity.

Throws

SAXException - The application may raise an exception.

See Also

internalEntityDecl(String, String), org.xml.sax.DTDHandler#unparsedEntityDecl

getCurrentNode()

Description

Get the current node being build

Syntax

public XMLNode getCurrentNode()

Returns