Oracle9i XML Reference Release 1 (9.0.1) Part Number A88899-01 |
|
public class AttrDecl extends XMLNode implements oracle.xml.parser.v2.XMLConstants, java.io.Serializable java.lang.Object | +--XMLNode | +--oracle.xml.parser.v2.AttrDecl
java.lang.Cloneable, org.w3c.dom.Node, java.io.Serializable, oracle.xml.parser.v2.XMLConstants
This class holds information about each attribute declared in an attribute list in the Document Type Definition.
Inherited Member Summary |
---|
Fields inherited from class XMLNode |
|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Fields inherited from interface |
|
Methods inherited from class XMLNode |
|
Methods inherited from class java.lang.Object |
|
Methods inherited from interface Node |
|
public static final int CDATA
AttType - StringType - CDATA
public static final int DEFAULT
Attribute presence - Default
public static final int ENTITIES
AttType - TokenizedType - Entities
public static final int ENTITY
AttType - TokenizedType - Entity
public static final int ENUMERATION
AttType - EnumeratedType - Enumeration
public static final int FIXED
Attribute presence - Fixed
public static final int ID
AttType - TokenizedType - ID
public static final int IDREF
AttType - TokenizedType - ID reference
public static final int IDREFS
AttType - TokenizedType - ID references
public static final int IMPLIED
Attribute presence - Implied
public static final int NMTOKEN
AttType - TokenizedType - Name token
public static final int NMTOKENS
AttType - TokenizedType - Name tokens
public static final int NOTATION
AttType - EnumeratedType - Notation
public static final int REQUIRED
Attribute presence - Required
public int getAttrPresence()
Gets attribute presence
The presence of the attribute
public int getAttrType()
Gets attribute type
The type of the attribute
public java.lang.String getDefaultValue()
Gets attribute default value
The default value of the attribute
public java.util.Vector getEnumerationValues()
Gets attribute values
The values of the attribute as an Enumeration
public class DefaultXMLDocumentHandler extends org.xml.sax.HandlerBase implements XMLDocumentHandler java.lang.Object | +--org.xml.sax.HandlerBase | +--oracle.xml.parser.v2.DefaultXMLDocumentHandler
XMLTokenizer
org.xml.sax.DocumentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, XMLDocumentHandler
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
public DefaultXMLDocumentHandler()
Constructs a default document handler
public void cDATASection(char[] ch, int start, int length)
Receive notification of a CDATA Section.
The Parser will invoke this method once for each CDATA Section found.
cDATASection(char[ ], int, int) in interface XMLDocumentHandler
ch
- The CDATA section characters.
start
- The start position in the character array.
length
- The number of characters to use from the character array.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
public void comment(java.lang.String data)
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.
comment(String) in interface XMLDocumentHandler
data
- The comment data, or null if none was supplied.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
public void endDoctype()
Receive notification of end of the DTD.
endDoctype() in interface XMLDocumentHandler
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
public void endElement(NSName elem)
Receive notification of the end of an element. The SAX parser will invoke this method at the end of every element in the XML document; there will be a corresponding startElement() event for every endElement() event (even when the element is empty).
By implementing this method instead of org.xml.sax.DocumentHandler.endElement
, SAX Applications can get the Namespace support provided by NSName
.
endElement(NSName) in interface XMLDocumentHandler
elem
- NSName object
org.xml.sax.SAXException - A SAXException
could be thrown.
org.xml.sax.DocumentHandler.endElement(String)
public void setDoctype(DTD dtd)
Receive notification of DTD. Sets the DTD
setDoctype(DTD) in interface XMLDocumentHandler
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
public void setTextDecl(java.lang.String version, java.lang.String encoding)
Receive notification of a Text XML Declaration.
The Parser will invoke this method once for each text XML Decl
setTextDecl(String, String) in interface XMLDocumentHandler
version
- The version number (or null, if not specified)
encoding
- The encoding name
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
public void setXMLDecl(java.lang.String version, java.lang.String standalone, java.lang.String encoding)
Receive notification of an XML Declaration.
The Parser will invoke this method once for XML Decl
setXMLDecl(String, String, String) in interface XMLDocumentHandler
version
- The version number
standalone
- The standalone value (or null, if not specifed)
encoding
- The encoding name (or null, if not specifed)
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
public void startElement(NSName elem, SAXAttrList attrlist)
Receive notification of the beginning of an element. The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding endElement() event for every startElement() event (even when the element is empty). All of the element's content will be reported, inorder, before the corresponding endElement() event.
By implementing this method instead of org.xml.sax.DocumentHandler.startElement
, SAX Applications can get the Namespace support provided by NSName
and SAXAttrList
.
startElement(NSName, SAXAttrList) in interface XMLDocumentHandler
elem
- NSName object
attrlist
- SAXAttrList for the element
org.xml.sax.SAXException - A SAXException
could be thrown.
org.xml.sax.DocumentHandler.startElement(String, AttributeList)
public class DOMParser extends XMLParser implements oracle.xml.parser.v2.XMLConstants java.lang.Object | +--XMLParser | +--oracle.xml.parser.v2.DOMParser
oracle.xml.parser.v2.XMLConstants
This class implements an eXtensible Markup Language (XML) 1.0 parser according to the World Wide Web Consortium (W3C) recommendation to parse a XML document and build a DOM tree.
Inherited Member Summary |
---|
Fields inherited from class XMLParser |
|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Methods inherited from class XMLParser |
|
Methods inherited from class java.lang.Object |
|
public DOMParser()
Creates a new parser object.
public DTD getDoctype()
Get the DTD
The DTD
public XMLDocument getDocument()
Gets the document
The document being parsed
public final void parseDTD(org.xml.sax.InputSource in, java.lang.String rootName)
Parses the XML External DTD from given input source
in
- the org.xml.sax.InputSouce
to parse
rootName
- the element to be used as root Element
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public final void parseDTD(java.io.InputStream in, java.lang.String rootName)
Parses the XML External DTD from given input stream. The base URL should be set for resolving external entities and DTD.
in
- the InputStream
containing XML data to parse.
rootName
- the element to be used as root Element
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public final void parseDTD(java.io.Reader r, java.lang.String rootName)
Parses the XML External DTD from given input stream. The base URL should be set for resolving external entities and DTD.
r
- the Reader
containing XML data to parse.
rootName
- the element to be used as root Element
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public final void parseDTD(java.lang.String in, java.lang.String rootName)
Parses the XML External DTD from the URL indicated
in
- the String
containing the URL to parse from
rootName
- the element to be used as root Element
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public final void parseDTD(java.net.URL url, java.lang.String rootName)
Parses the XML External DTD document pointed to by the given URL and creates the corresponding XML document hierarchy.
url
- the url points to the XML document to parse.
rootName
- the element to be used as root Element
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public final void setErrorStream(java.io.OutputStream out)
Creates an output stream for the output of errors and warnings. If an output stream for errors is not specified, the parser will use the standard error output stream System.err
for outputting errors and warnings.
out
- The output stream to use for errors and warnings
public final void setErrorStream(java.io.OutputStream out, java.lang.String enc)
Creates an output stream for the output of errors and warnings. If an output stream for errors is not specified, the parser will use the standard error output stream System.err
for outputting errors and warnings. Additionally, an .exception is thrown if the encoding specified is unsupported.
out
- The output stream to use for errors and warnings
enc
- the encoding to use
IOException
- if an unsupported encoding is specified
public final void setErrorStream(java.io.PrintWriter out)
Creates an output stream for the output of errors and warnings. If an output stream for errors is not specified, the parser will use the standard error output stream System.err
for outputting errors and warnings.
out
- The PrintWriter
to use for errors and warnings
public void setNodeFactory(NodeFactory factory)
Set the node factory. Applications can extend the NodeFactory and register it through this method. The parser will then use the user supplied NodeFactory to create nodes of the DOM tree.
factory
- The NodeFactory
to set
XMLParseException - if an invalid factory is set
public void showWarnings(boolean yes)
Switch to determine whether to print warnings
yes
- determines whether warnings should be shown
public class DTD extends XMLNode implements org.w3c.dom.DocumentType, java.io.Serializable java.lang.Object | +--XMLNode | +--oracle.xml.parser.v2.DTD
java.lang.Cloneable, org.w3c.dom.DocumentType, org.w3c.dom.Node, java.io.Serializable, oracle.xml.parser.v2.XMLConstants
Implements the DOM DocumentType interface and holds the Document Type Definition information for an XML document.
Inherited Member Summary |
---|
Fields inherited from class XMLNode |
|
Fields inherited from interface Node |
|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Methods inherited from class XMLNode |
|
Methods inherited from class java.lang.Object |
|
Methods inherited from interface Node |
|
public org.w3c.dom.Node cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent ( parentNode
returns null
.). Cloning an Element
copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child Text
node. Cloning any other type of node simply returns a copy of this node.
org.w3c.dom.Node.cloneNode(boolean) in interface org.w3c.dom.Node
cloneNode(boolean) in class XMLNode
deep
- If true
, recursively clone the subtree under the specified node; if false
, clone only the node itself (and its attributes, if it is an Element
).
The duplicate node.
public final ElementDecl findElementDecl(java.lang.String name)
Finds an element declaration for the given tag name.
name
- The tag name.
the element declaration object.
public final org.w3c.dom.Entity findEntity(java.lang.String n, boolean par)
Finds a named entity in the DTD.
n
- The name of the entity.
the specified Entity
object; returns null if it is not found.
public final org.w3c.dom.Notation findNotation(java.lang.String name)
Retrieves the named notation from the DTD.
name
- The name of the notation.
the Notation
object; returns null if it is not found.
public org.w3c.dom.NodeList getChildNodes()
A NodeList
that contains all children of this node. If there are no children, this is a NodeList
containing no nodes. The content of the returned NodeList
is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the NodeList
accessors; it is not a static snapshot of the content of the node. This is true for every NodeList
, including the ones returned by the getElementsByTagName
method.
org.w3c.dom.Node.getChildNodes() in interface org.w3c.dom.Node
getChildNodes() in class XMLNode
The children of this node
public org.w3c.dom.NamedNodeMap getElementDecls()
A NamedNodeMap
containing the element declarations in the DTD. Every node in this map is an ElementDecl
object.
The element declarations in the DTD The DOM Level 1 does not support editing elementdecls, therefore elementdecls
cannot be altered in any way.
public org.w3c.dom.NamedNodeMap getEntities()
A NamedNodeMap
containing the general entities, both external and internal, declared in the DTD. Duplicates are discarded. For example in:<!DOCTYPE ex SYSTEM "ex.dtd" [ <!ENTITY foo "foo"> <!ENTITY bar "bar"> <!ENTITY % baz "baz">]> <ex/> the interface provides access to foo
and bar
but not baz
. Every node in this map also implements the Entity
interface. The DOM Level 1 does not support editing entities, therefore entities
cannot be altered in any way.
org.w3c.dom.DocumentType.getEntities() in interface org.w3c.dom.DocumentType
The entities declared in the DTD
public java.lang.String getName()
Gets the name of the DTD; i.e., the name immediately following the DOCTYPE
keyword.
org.w3c.dom.DocumentType.getName() in interface org.w3c.dom.DocumentType
Name of the DTD
public org.w3c.dom.NamedNodeMap getNotations()
A NamedNodeMap
containing the notations declared in the DTD. Duplicates are discarded. Every node in this map also implements the Notation
interface. The DOM Level 1 does not support editing notations, therefore notations
cannot be altered in any way.
org.w3c.dom.DocumentType.getNotations() in interface org.w3c.dom.DocumentType
The notations declared in the DTD
public java.lang.String getPublicId()
Gets The public identifier associated with the DTD, if specified. If the public identifier was not specified, this is null
.
the public identifier associated with the DTD
public java.lang.String getSystemId()
Gets the system identifier associated with the DTD, if specified. If the system identifier was not specified, this is null
.
the system identifier associated with the DTD
public boolean hasChildNodes()
This is a convenience method to allow easy determination of whether a node has any children. return false always, as DTD cannot have any overrides method in XMLNode
org.w3c.dom.Node.hasChildNodes() in interface org.w3c.dom.Node
hasChildNodes() in class XMLNode
false
as DTD node can not have any children,
public void printExternalDTD(java.io.OutputStream out)
Writes the contents of this document to the given output stream.
out
- OutputStream
to write to
IOException
- if an error occurs
public void printExternalDTD(java.io.OutputStream out, java.lang.String enc)
Writes the contents of the external DTD to the given output stream.
out
- OutputStream
to write to
enc
- Encoding to use for the output
IOException
- if an invalid encoding was specified or if any other error occurs
public void printExternalDTD(java.io.PrintWriter out)
Writes the contents of this document to the given output stream.
out
- PrintWriter
to write to
IOException
- if an error occurs
public class ElementDecl extends XMLNode implements java.io.Serializable java.lang.Object | +--XMLNode | +--oracle.xml.parser.v2.ElementDecl
java.lang.Cloneable, org.w3c.dom.Node, java.io.Serializable, oracle.xml.parser.v2.XMLConstants
This class represents an element declaration in a DTD.
Inherited Member Summary |
---|
Fields inherited from class XMLNode |
|
Fields inherited from interface Node |
|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Methods inherited from class XMLNode |
|
Methods inherited from class java.lang.Object |
|
Methods inherited from interface Node |
|
public static final byte ANY
Element content type - Children can be any element
public static final int ASTERISK
ContentModelParseTreeNode type - "*" node (has one children)
public static final int COMMA
ContentModelParseTreeNode type - "," node (has two children)
public static final int ELEMENT
ContentModelParseTreeNode type - 'leaf' node (has no children)
public static final byte ELEMENTS
Element content type - Children can be elements as per Content Model
public static final byte EMPTY
Element content type - No Children
public static final byte MIXED
Element content type - Children can be PCDATA & elements as per Content Model
public static final int OR
ContentModelParseTreeNode type - "|" node (has two children)
public static final int PLUS
ContentModelParseTreeNode type - "+" node (has one children)
public static final int QMARK
ContentModelParseTreeNode type - "?" node (has one children)
public java.util.Vector expectedElements(org.w3c.dom.Element e)
Returns vector of element names that can be appended to the element.
e
- Element
Vector of names
public final AttrDecl findAttrDecl(java.lang.String name)
Gets an attribute declaration object or null if not found
name
- Attribute declaration to find
The AttrDecl
object, or null, if it was not found
public org.w3c.dom.NamedNodeMap getAttrDecls()
Gets an enumeration of attribute declarations
An enumeration of attribute declarations
public final java.util.Vector getContentElements()
Returns Vector of elements that can be appended to this element
The Vector
containing the element names.
public int getContentType()
Returns content model of element
The type
of the element declaration.
public final org.w3c.dom.Node getParseTree()
Returns the root node of Content Model Parse Tree. Node.getFirstChild()
and Node.getLastChild()
return the the parse tree branches. Node.getNodeType()
and Node.getNodeName()
return the the parse tree node type and name.
The Node
containing the Content Model parse tree root node.
public boolean validateContent(org.w3c.dom.Element e)
Validates the content of a element node.
True if valid, else false
public class NodeFactory extends java.lang.Object implements java.io.Serializable java.lang.Object | +--oracle.xml.parser.v2.NodeFactory
java.io.Serializable
This class specifies methods to create various nodes of the DOM tree built during parsing. Applications can override these methods to create their own custom classes to be added to the DOM tree while parsing. Applications have to register their own NodeFactory using the XMLParser's setNodeFactory() method. If a null pointer is returned by these methods, then the node will not be added to the DOM tree.
setNodeFactory(NodeFactory)
Inherited Member Summary |
---|
Methods inherited from class java.lang.Object |
|
public NodeFactory()
public XMLAttr createAttribute(java.lang.String tag, java.lang.String text)
Creates an attribute node with the specified tag, and text.
tag
- The name of the node.
text
- The text associated with the node.
The created attribute node.
public XMLCDATA createCDATASection(java.lang.String text)
Creates a CDATA node with the specified text.
text
- The text associated with the node.
The created CDATA node.
public XMLComment createComment(java.lang.String text)
Creates a comment node with the specified text.
text
- The text associated with the node.
The created comment node.
public XMLDocument createDocument()
Creates a document node. This method cannot return a null pointer.
The created element.
public XMLElement createElement(java.lang.String tag)
Creates an Element node with the specified tag.
tag
- The name of the element.
The created element.
public XMLPI createProcessingInstruction(java.lang.String tag, java.lang.String text)
Creates a PI node with the specified tag, and text.
tag
- The name of the node.
text
- The text associated with the node.
The created PI node.
public XMLText createTextNode(java.lang.String text)
Creates a text node with the specified text.
text
- The text associated with the node.
The created text node.
public interface NSName
XMLAttr, XMLElement
This interface provides Namespace support for Element and Attr names
Member Summary |
|
---|---|
Methods |
|
Get the fully resolved name for this name |
|
Get the local name for this name |
|
Get the resolved Namespace for this name |
|
Get the prefix for this name |
|
Get the qualified name |
public java.lang.String getExpandedName()
Get the fully resolved name for this name
The fully resolved name
public java.lang.String getLocalName()
Get the local name for this name
The local name
public java.lang.String getNamespace()
Get the resolved Namespace for this name
The resolved Namespace
public java.lang.String getPrefix()
Get the prefix for this name
The prefix
public java.lang.String getQualifiedName()
Get the qualified name
The qualified name
public interface NSResolver
XMLElement
This interface provides support for resolving Namespaces
Member Summary |
|
---|---|
Methods |
|
Find the namespace definition in scope for a given namespace prefix |
public java.lang.String resolveNamespacePrefix(java.lang.String prefix)
Find the namespace definition in scope for a given namespace prefix
prefix
- Namespace prefix to be resolved
the resolved Namespace (null, if prefix could not be resolved)
public class oraxsl extends java.lang.Object java.lang.Object | +--oracle.xml.parser.v2.oraxsl
The oraxsl class provides a command-line interface to applying stylesheets on multiple XML documents. It accepts a number of command-line options that dictate how it should behave. The following is its invocation syntax:
java oraxsl options*source?stylesheet?result? -w (Show warnings) -e<error log> (A file to write errors to) -l<xml file list> (List of files to transform) -d<directory> (Directory with files to transform) -x<source extension> (Extensions to exclude) -i<source extension> (Extensions to include) -s<stylesheet> (Stylesheet to use) -r<result extension> (Extension to use for results) -o<result extension> (Directory to place results) -p<param list> (List of Params) -t<# of threads> (Number of threads to us) -v (Verbose mode)
Member Summary |
|
---|---|
Constructors |
|
|
|
Methods |
|
Invokes the oraxsl driver |
Inherited Member Summary |
---|
Methods inherited from class java.lang.Object |
|
public oraxsl()
public static void main(java.lang.String[] args)
Invokes the oraxsl driver
args
- command line arguments
public class SAXAttrList extends java.lang.Object implements org.xml.sax.AttributeList java.lang.Object | +--oracle.xml.parser.v2.SAXAttrList
org.xml.sax.AttributeList
This class implements the SAX AttributeList
interface and also provides Namespace support. Applications that require Namespace support can explicitly cast any attribute list returned by an Oracle parser class to SAXAttrList
and use the methods described here.
Inherited Member Summary |
---|
Methods inherited from class java.lang.Object |
|
public java.lang.String getExpandedName(int i)
Get the expanded name for an attribute in the list (by position)
i
- The index of the attribute in the list.
The expanded name for the attribute
public int getLength()
Return the number of attributes in this list.
The SAX parser may provide attributes in any arbitrary order, regardless of the order in which they were declared or specified. The number of attributes may be zero.
org.xml.sax.AttributeList.getLength() in interface org.xml.sax.AttributeList
The number of attributes in the list.
public java.lang.String getLocalName(int i)
Get the local name for an attribute in the list (by position)
i
- The index of the attribute in the list.
The local name for the attribute
public java.lang.String getName(int i)
Return the name of an attribute in this list (by position).
The names must be unique the SAX parser shall not include the same attribute twice. Attributes without values (those declared #IMPLIED without a value specified in the start tag) will be omitted from the list.
If the attribute name has a namespace prefix, the prefix will still be attached.
org.xml.sax.AttributeList.getName(int) in interface org.xml.sax.AttributeList
i
- The index of the attribute in the list (starting at 0).
The name of the indexed attribute, or null if the index is out of range.
public java.lang.String getNamespace(int i)
Get the resolved namespace for an attribute in the list (by position)
i
- The index of the attribute in the list.
The resolved namespace for the attribute
public java.lang.String getPrefix(int i)
Get the namespace prefix for an attribute in the list (by position)
i
- The index of the attribute in the list.
The namespace prefix for the attribute
public java.lang.String getQualifiedName(int i)
Get the qualified name for an attribute in the list (by position)
i
- The index of the attribute in the list.
The qualified name for the attribute
public java.lang.String getType(int i)
org.xml.sax.AttributeList.getType(int) in interface org.xml.sax.AttributeList
public java.lang.String getType(java.lang.String s)
Return the type of an attribute in the list (by name).
The return value is the same as the return value for getType(int).
If the attribute name has a namespace prefix in the document, the application must include the prefix here.
org.xml.sax.AttributeList.getType(String) in interface org.xml.sax.AttributeList
name
- The name of the attribute.
The attribute type as a string, or null if no such attribute exists.
public java.lang.String getValue(int i)
Return the value of an attribute in the list (by position).
If the attribute value is a list of tokens (IDREFS, ENTITIES, or NMTOKENS), the tokens will be concatenated into a single string separated by whitespace.
org.xml.sax.AttributeList.getValue(int) in interface org.xml.sax.AttributeList
i
- The index of the attribute in the list (starting at 0).
The attribute value as a string, or null if the index is out of range.
public java.lang.String getValue(java.lang.String s)
Return the value of an attribute in the list (by name).
The return value is the same as the return value for getValue(int).
If the attribute name has a namespace prefix in the document, the application must include the prefix here.
org.xml.sax.AttributeList.getValue(String) in interface org.xml.sax.AttributeList
i
- The index of the attribute in the list.
The attribute value as a string, or null if no such attribute exists.
public class SAXParser extends XMLParser implements org.xml.sax.Parser, oracle.xml.parser.v2.XMLConstants java.lang.Object | +--XMLParser | +--oracle.xml.parser.v2.SAXParser
org.xml.sax.Parser, oracle.xml.parser.v2.XMLConstants
This class implements an eXtensible Markup Language (XML) 1.0 SAX parser according to the World Wide Web Consortium (W3C) recommendation. Applications can register a SAX handler to receive notification of various parser events.
Inherited Member Summary |
---|
Fields inherited from class XMLParser |
|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Methods inherited from class XMLParser |
|
Methods inherited from class java.lang.Object |
|
Methods inherited from interface Parser |
|
public SAXParser()
Creates a new parser object.
public void setDocumentHandler(org.xml.sax.DocumentHandler handler)
SAX applications can use this to register a new document event handler.
org.xml.sax.Parser.setDocumentHandler(DocumentHandler) in interface org.xml.sax.Parser
handler
- DocumentHandler
being registered
org.xml.sax.Parser.setDocumentHandler(DocumentHandler), org.xml.sax.DocumentHandler
public void setDTDHandler(org.xml.sax.DTDHandler handler)
SAX applications can use this to register a new DTD event handler.
org.xml.sax.Parser.setDTDHandler(DTDHandler) in interface org.xml.sax.Parser
handler
- DTDHandler
being registered
org.xml.sax.Parser.setDTDHandler(DTDHandler), org.xml.sax.DTDHandler
public void setEntityResolver(org.xml.sax.EntityResolver resolver)
SAX applications can use this to register a new entity resolver
org.xml.sax.Parser.setEntityResolver(EntityResolver) in interface org.xml.sax.Parser
resolver
- EntityResolver
being registered
org.xml.sax.Parser.setEntityResolver(EntityResolver), org.xml.sax.DTDHandler
public void setErrorHandler(org.xml.sax.ErrorHandler handler)
SAX applications can use this to register a new error event handler. This replaces any previous setting for error handling.
org.xml.sax.Parser.setErrorHandler(ErrorHandler) in interface org.xml.sax.Parser
handler
- ErrorHandler
being registered
org.xml.sax.Parser.setErrorHandler(ErrorHandler), org.xml.sax.ErrorHandler
public class XMLAttr extends XMLNode implements org.w3c.dom.Attr, NSName, java.io.Serializable java.lang.Object | +--XMLNode | +--oracle.xml.parser.v2.XMLAttr
org.w3c.dom.Attr, java.lang.Cloneable, org.w3c.dom.Node, NSName, java.io.Serializable, oracle.xml.parser.v2.XMLConstants
This class implements the DOM Attr interface and holds information on each attribute of an element.
org.w3c.dom.Attr, NodeFactory, setNodeFactory(NodeFactory)
Inherited Member Summary |
---|
Fields inherited from class XMLNode |
|
Fields inherited from interface Node |
|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Methods inherited from class XMLNode |
|
Methods inherited from class java.lang.Object |
|
Methods inherited from interface Node |
|
public XMLAttr(java.lang.String n, java.lang.String v)
Construct attribute with given name and value.
n
- Name of the attribute
v
- Value of the attribute
public XMLAttr(java.lang.String name, java.lang.String prefix, java.lang.String ns, java.lang.String v)
Namespace support
public org.w3c.dom.Node cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent ( parentNode
returns null
.). Cloning an Element
copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child Text
node. Cloning any other type of node simply returns a copy of this node.
org.w3c.dom.Node.cloneNode(boolean) in interface org.w3c.dom.Node
cloneNode(boolean) in class XMLNode
deep
- If true
, recursively clone the subtree under the specified node; if false
, clone only the node itself (and its attributes, if it is an Element
).
The duplicate node.
public java.lang.String getExpandedName()
Get the fully resolved Name for this attribute
getExpandedName() in interface NSName
the fully resolved Name
public java.lang.String getLocalName()
Get the local Name for this attribute
getLocalName() in interface NSName
the local Name
public java.lang.String getName()
Gets the attribute name.
org.w3c.dom.Attr.getName() in interface org.w3c.dom.Attr
attribute name
public java.lang.String getNamespace()
Get the resolved Namespace for this attribute
getNamespace() in interface NSName
the resolved Namespace
public java.lang.String getNodeValue()
Gets the value of this node, depending on its type
org.w3c.dom.Node.getNodeValue() in interface org.w3c.dom.Node
getNodeValue() in class XMLNode
Value of this node
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString
variable on the implementation platform.
public org.w3c.dom.Node getParentNode()
Gets the parent of this node. All nodes, except Document
, DocumentFragment
, and Attr
may have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is null
.
org.w3c.dom.Node.getParentNode() in interface org.w3c.dom.Node
getParentNode() in class XMLNode
The parent of this node
public java.lang.String getPrefix()
Get the namespace prefix for this attribute
getPrefix() in interface NSName
the namespace prefix
public java.lang.String getQualifiedName()
Gets the qualified name for this attribute
getQualifiedName() in interface NSName
the qualified name
public boolean getSpecified()
Returns true if the attribute was specified explicity in the element
org.w3c.dom.Attr.getSpecified() in interface org.w3c.dom.Attr
true
, if the attribute was specified explicitly, false
, if it was not
public java.lang.String getValue()
Gets the attribute value.
org.w3c.dom.Attr.getValue() in interface org.w3c.dom.Attr
attribute value
public void setNodeValue(java.lang.String nodeValue)
Sets the value of this node, depending on its type
org.w3c.dom.Node.setNodeValue(String) in interface org.w3c.dom.Node
setNodeValue(String) in class XMLNode
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString
variable on the implementation platform.
public void setValue(java.lang.String arg)
Sets the value.
org.w3c.dom.Attr.setValue(String) in interface org.w3c.dom.Attr
arg
- Value to set
public class XMLCDATA extends XMLText implements org.w3c.dom.CDATASection, java.io.Serializable java.lang.Object | +--XMLNode | +--oracle.xml.parser.v2.CharData | +--XMLText | +--oracle.xml.parser.v2.XMLCDATA
org.w3c.dom.CDATASection, org.w3c.dom.CharacterData, java.lang.Cloneable, org.w3c.dom.Node, java.io.Serializable, org.w3c.dom.Text, oracle.xml.parser.v2.XMLConstants
This class implements the DOM CDATASection interface.
org.w3c.dom.CDATASection, NodeFactory, setNodeFactory(NodeFactory)
Member Summary |
|
---|---|
Constructors |
|
Creates a CDATA node having the given name and text. |
Inherited Member Summary |
---|
Fields inherited from class XMLNode |
|
Fields inherited from interface Node |
|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Methods inherited from class XMLText |
|
Methods inherited from class oracle.xml.parser.v2.CharData |
|
Methods inherited from class XMLNode |
|
Methods inherited from class java.lang.Object |
|
Methods inherited from interface Text |
|
Methods inherited from interface CharacterData |
|
Methods inherited from interface Node |
|
public XMLCDATA(java.lang.String text)
Creates a CDATA node having the given name and text.
text
- Text of the node
public class XMLComment extends oracle.xml.parser.v2.CharData implements org.w3c.dom.Comment, java.io.Serializable java.lang.Object | +--XMLNode | +--oracle.xml.parser.v2.CharData | +--oracle.xml.parser.v2.XMLComment
org.w3c.dom.CharacterData, java.lang.Cloneable, org.w3c.dom.Comment, org.w3c.dom.Node, java.io.Serializable, oracle.xml.parser.v2.XMLConstants
This class implements the DOM Comment interface.
org.w3c.dom.Comment, NodeFactory, setNodeFactory(NodeFactory)
Member Summary |
|
---|---|
Constructors |
|
Creates a new Comment node. |
Inherited Member Summary |
---|
Fields inherited from class XMLNode |
|
Fields inherited from interface Node |
|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Methods inherited from class oracle.xml.parser.v2.CharData |
|
Methods inherited from class XMLNode |
|
Methods inherited from class java.lang.Object |
|
Methods inherited from interface CharacterData |
|
Methods inherited from interface Node |
|
public XMLComment(java.lang.String text)
Creates a new Comment node.
text
- Text of the comment node
public class XMLDocument extends XMLNode implements org.w3c.dom.Document, java.io.Serializable java.lang.Object | +--XMLNode | +--oracle.xml.parser.v2.XMLDocument
java.lang.Cloneable, org.w3c.dom.Document, org.w3c.dom.Node, java.io.Serializable, oracle.xml.parser.v2.XMLConstants
This class implements the DOM Document interface, represents an entire XML document and serves the root of the Document Object Model tree. Each XML tag can either represent a node or a leaf of this tree.
According to the XML specification, the root of the tree consists of any combination of comments and processing instructions, but only one root element. A helper method getDocumentElement
is provided as a short cut to finding the root element.
Inherited Member Summary |
---|
Fields inherited from class XMLNode |
|
Fields inherited from interface Node |
|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Methods inherited from class XMLNode |
|
Methods inherited from class java.lang.Object |
|
Methods inherited from interface Node |
|
public XMLDocument()
Creates an empty document.
public org.w3c.dom.Node cloneNode(boolean deep)
Returns a duplicate of this document node.
org.w3c.dom.Node.cloneNode(boolean) in interface org.w3c.dom.Node
cloneNode(boolean) in class XMLNode
deep
- If true
, recursively clone the subtree under the document; if false
, clone only the document itself
The duplicate document node.
public org.w3c.dom.Attr createAttribute(java.lang.String name)
Creates an Attr
of the given name. Note that the Attr
instance can then be set on an Element
using the setAttribute
method.
org.w3c.dom.Document.createAttribute(String) in interface org.w3c.dom.Document
name
- The name of the attribute.
A new Attr
object.
org.w3c.dom.DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.
public org.w3c.dom.CDATASection createCDATASection(java.lang.String data)
Creates a CDATASection
node whose value is the specified string.
org.w3c.dom.Document.createCDATASection(String) in interface org.w3c.dom.Document
data
- The data for the CDATASection
contents.
The new CDATASection
object.
org.w3c.dom.DOMException - A DOMException
could be thrown.
public org.w3c.dom.Comment createComment(java.lang.String data)
Creates a Comment
node given the specified string.
org.w3c.dom.Document.createComment(String) in interface org.w3c.dom.Document
data
- The data for the node.
The new Comment
object.
public org.w3c.dom.DocumentFragment createDocumentFragment()
Creates an empty DocumentFragment
object.
org.w3c.dom.Document.createDocumentFragment() in interface org.w3c.dom.Document
A new DocumentFragment
.
public org.w3c.dom.Element createElement(java.lang.String tagName)
Creates an element of the type specified. Note that the instance returned implements the Element interface, so attributes can be specified directly on the returned object.
org.w3c.dom.Document.createElement(String) in interface org.w3c.dom.Document
tagName
- The name of the element type to instantiate. The name is treated as case-sensitive.
A new Element
object.
org.w3c.dom.DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.
public org.w3c.dom.EntityReference createEntityReference(java.lang.String name)
Creates an EntityReference object.
org.w3c.dom.Document.createEntityReference(String) in interface org.w3c.dom.Document
name
- The name of the entity to reference.
The new EntityReference
object.
org.w3c.dom.DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.
public org.w3c.dom.ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data)
Creates a ProcessingInstruction
node given the specified name and data strings.
org.w3c.dom.Document.createProcessingInstruction(String, String) in interface org.w3c.dom.Document
target
- The target part of the processing instruction.
data
- The data for the node.
The new ProcessingInstruction
object.
org.w3c.dom.DOMException - INVALID_CHARACTER_ERR: Raised if an invalid character is specified.
public org.w3c.dom.Text createTextNode(java.lang.String data)
Creates a Text
node given the specified string.
org.w3c.dom.Document.createTextNode(String) in interface org.w3c.dom.Document
data
- The data for the node.
The new Text
object.
public java.util.Vector expectedElements(org.w3c.dom.Element e)
Returns vector of element names that can be appended to the element.
e
- Element
Vector of names
public org.w3c.dom.DocumentType getDoctype()
The Document Type Declaration (DTD) associated with this document. For XML documents without a DTD, this returns null
. Note that the DOM Level 1 specification does not support editing the DTD.
org.w3c.dom.Document.getDoctype() in interface org.w3c.dom.Document
The associated DTD
org.w3c.dom.DocumentType
public org.w3c.dom.Element getDocumentElement()
This is a convenience attribute that allows direct access to the child node that is the root element of the document.
org.w3c.dom.Document.getDocumentElement() in interface org.w3c.dom.Document
The root element
public org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagname)
Returns a NodeList
of all the Element
s with a given tag name in the order in which they would be encountered in a preorder traversal of the Document
tree.
org.w3c.dom.Document.getElementsByTagName(String) in interface org.w3c.dom.Document
tagname
- The name of the tag to match on. The special value "*" matches all tags.
A new NodeList
object containing all the matched Element
s.
public final java.lang.String getEncoding()
Retrieves the character encoding information.
the encoding information stored in the <?xml ...?> tag or the user-defined output encoding if it has been more recently set.
public org.w3c.dom.DOMImplementation getImplementation()
The DOMImplementation
object that handles this document. A DOM application may use objects from multiple implementations.
org.w3c.dom.Document.getImplementation() in interface org.w3c.dom.Document
The associated DOM implementation.
public org.w3c.dom.Document getOwnerDocument()
The Document
object associated with this node. Since this node is a Document
this is null
.
org.w3c.dom.Node.getOwnerDocument() in interface org.w3c.dom.Node
getOwnerDocument() in class XMLNode
null
public final java.lang.String getStandalone()
Retrieves the standalone information.
the standalone attribute stored in the <?xml ...?> tag.
public final java.lang.String getVersion()
Retrieves the version information.
the version number stored in the <?xml ...?> tag.
public void print(java.io.OutputStream out)
Writes the contents of this document to the given output stream.
print(OutputStream) in class XMLNode
out
- OutputStream
to write to
IOException
- if an error occurs
public void print(java.io.OutputStream out, java.lang.String enc)
Writes the contents of this document to the given output stream.
print(OutputStream, String) in class XMLNode
out
- OutputStream
to write to
enc
- Encoding to use for the output
IOException
- if an invalid encoding was specified or if any other error occurs
public void print(java.io.PrintWriter out)
Writes the contents of this document to the given output stream.
print(PrintWriter) in class XMLNode
out
- PrintWriter
to write to
IOException
- if an error occurs
public void printExternalDTD(java.io.OutputStream out)
Writes the contents of this document to the given output stream.
out
- OutputStream
to write to
IOException
- if an error occurs
public void printExternalDTD(java.io.OutputStream out, java.lang.String enc)
Writes the contents of the external DTD to the given output stream.
out
- OutputStream
to write to
enc
- Encoding to use for the output
IOException
- if an invalid encoding was specified or if any other error occurs
public void printExternalDTD(java.io.PrintWriter out)
Writes the contents of this document to the given output stream.
out
- PrintWriter
to write to
IOException
- if an error occurs
public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
Replaces the child node oldChild
with newChild
in the list of children, and returns the oldChild
node. If the newChild
is already in the tree, it is first removed. This is an override of the XMLNode.removeChild
method
org.w3c.dom.Node.replaceChild(Node, Node) in interface org.w3c.dom.Node
replaceChild(Node, Node) in class XMLNode
newChild
- The new node to put in the child list.
oldChild
- The node being replaced in the list.
The node replaced.
org.w3c.dom.DOMException - HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild
node. WRONG_DOCUMENT_ERR: Raised if newChild
was created from a different document than this one. NOT_FOUND_ERR: Raised if oldChild
is not a child of this node.
public final void setEncoding(java.lang.String encoding)
Sets the character encoding for output. Eventually it sets the ENCODING stored in the <?xml ...?> tag, but not until the document is saved. You should not call this method until the Document has been loaded.
encoding
- The character encoding to set
public final void setLocale(java.util.Locale locale)
Sets the locale for error reporting
locale
- Locale for error reporting.
public final void setStandalone(java.lang.String value)
Sets the standalone information stored in the <?xml ...?> tag.
value
- The attribute value ('yes' or 'no').
public final void setVersion(java.lang.String version)
Sets the version number stored in the <?xml ...?> tag.
version
- The version information to set.
public boolean validateElementContent(org.w3c.dom.Element e)
Validates the content of a element node.
e
- Element to be validated
True if valid, else false
public class XMLDocumentFragment extends XMLNode implements org.w3c.dom.DocumentFragment, java.io.Serializable java.lang.Object | +--XMLNode | +--oracle.xml.parser.v2.XMLDocumentFragment
java.lang.Cloneable, org.w3c.dom.DocumentFragment, org.w3c.dom.Node, java.io.Serializable, oracle.xml.parser.v2.XMLConstants
This class implements the DOM DocumentFragment interface.
org.w3c.dom.DocumentFragment, NodeFactory, setNodeFactory(NodeFactory)
Member Summary |
|
---|---|
Constructors |
|
Creates an empty document fragment |
|
Methods |
|
Gets the parent of this node |
Inherited Member Summary |
---|
Fields inherited from class XMLNode |
|
Fields inherited from interface Node |
|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Methods inherited from class XMLNode |
|
Methods inherited from class java.lang.Object |
|
Methods inherited from interface Node |
|
public XMLDocumentFragment()
Creates an empty document fragment
public org.w3c.dom.Node getParentNode()
Gets the parent of this node
org.w3c.dom.Node.getParentNode() in interface org.w3c.dom.Node
getParentNode() in class XMLNode
The parent of this node (always null)
public interface XMLDocumentHandler extends org.xml.sax.DocumentHandler
org.xml.sax.DocumentHandler
Package oracle.xml.parser.v2
This interface extends the org.xml.sax.DocumentHandler
interface. SAX Applications requiring Namespace support must implement this interface and register with the SAX Parser via Parser.setDocumentHandler()
.
public void cDATASection(char[] ch, int start, int length)
Receive notification of a CDATA Section.
The Parser will invoke this method once for each CDATA Section found.
ch
- The CDATA section characters.
start
- The start position in the character array.
length
- The number of characters to use from the character array.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
public void comment(java.lang.String data)
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.
data
- The comment data, or null if none was supplied.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
public void endDoctype()
Receive notification of end of the DTD.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
public void endElement(NSName elem)
Receive notification of the end of an element. The SAX parser will invoke this method at the end of every element in the XML document; there will be a corresponding startElement() event for every endElement() event (even when the element is empty).
By implementing this method instead of org.xml.sax.DocumentHandler.endElement
, SAX Applications can get the Namespace support provided by NSName
.
elem
- NSName object
org.xml.sax.SAXException - A SAXException
could be thrown.
public void setDoctype(DTD dtd)
Receive notification of a DTD (Document Type node).
The Parser will invoke this method after calling startDocument to register the DTD used.
DTD
- The DTD node
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
public void setTextDecl(java.lang.String version, java.lang.String encoding)
Receive notification of a Text XML Declaration.
The Parser will invoke this method once for each text XML Decl
version
- The version number (or null, if not specified)
encoding
- The encoding name
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
public void setXMLDecl(java.lang.String version, java.lang.String standalone, java.lang.String encoding)
Receive notification of a XML Declaration.
The Parser will invoke this method once for XML Decl
version
- The version number
standalone
- The standalone value (or null, if not specifed)
encoding
- The encoding name (or null, if not specifed)
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
public void startElement(NSName elem, SAXAttrList attrlist)
Receive notification of the beginning of an element. The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding endElement() event for every startElement() event (even when the element is empty). All of the element's content will be reported, inorder, before the corresponding endElement() event.
By implementing this method instead of org.xml.sax.DocumentHandler.startElement
, SAX Applications can get the Namespace support provided by NSName
and SAXAttrList
.
elem
- NSName object
attrlist
- SAXAttrList for the element
org.xml.sax.SAXException - A SAXException
could be thrown.
org.xml.sax.DocumentHandler.startElement(String, AttributeList):
public class XMLElement extends XMLNode implements org.w3c.dom.Element, java.io.Serializable, NSName, NSResolver java.lang.Object | +--XMLNode | +--oracle.xml.parser.v2.XMLElement
ava.lang.Cloneable, org.w3c.dom.Element, org.w3c.dom.Node, NSName, NSResolver, java.io.Serializable, oracle.xml.parser.v2.XMLConstants
This class implements the DOM Element
interface. Elements are created by the XML parser using the default NodeFactory or the user defined NodeFactory if registered using setNodeFactoty() method.
Inherited Member Summary |
---|
Fields inherited from class XMLNode |
|
Fields inherited from interface Node |
|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Methods inherited from class XMLNode |
|
Methods inherited from class java.lang.Object |
|
Methods inherited from interface Node |
|
public XMLElement(java.lang.String tag)
Creates an element with the given name
public XMLElement(java.lang.String name, java.lang.String prefix, java.lang.String namespace)
Creates an element with the given name, prefix, and namespace
public boolean checkNamespace(java.lang.String localname, java.lang.String ns)
Returns if the element belongs to the namespace specified.
ns
- Expanded namespace string
true - if the element belongs to the namespace
public org.w3c.dom.Node cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent ( parentNode
returns null
.). Cloning an Element
copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child Text
node. Cloning any other type of node simply returns a copy of this node.
org.w3c.dom.Node.cloneNode(boolean) in interface org.w3c.dom.Node
org.w3c.dom.Node.cloneNode(boolean) in interface org.w3c.dom.Node
cloneNode(boolean) in class XMLNode
deep
- If true
, recursively clone the subtree under the specified node; if false
, clone only the node itself (and its attributes, if it is an Element
).
The duplicate node.
public java.lang.String getAttribute(java.lang.String name)
Retrieves an attribute value by name.
org.w3c.dom.Element.getAttribute(String) in interface org.w3c.dom.Element
name
- The name of the attribute to retrieve.
The Attr
value as a string, or the empty string if that attribute does not have a specified or default value.
public org.w3c.dom.Attr getAttributeNode(java.lang.String name)
Retrieves an Attr
node by name.
org.w3c.dom.Element.getAttributeNode(String) in interface org.w3c.dom.Element
name
- The name of the attribute to retrieve.
The Attr
node with the specified attribute name or null
if there is no such attribute.
public org.w3c.dom.NamedNodeMap getAttributes()
A NamedNodeMap
containing the attributes of this node (if it is an Element
) or null
otherwise.
org.w3c.dom.Node.getAttributes() in interface org.w3c.dom.Node
getAttributes() in class XMLNode
The list of attributes of this element
public org.w3c.dom.NodeList getChildrenByTagName(java.lang.String name)
Returns a NodeList
of all immediate children with a given tag name,
name
- The name of the tag to match on.
A list of matching children
public org.w3c.dom.NodeList getChildrenByTagName(java.lang.String name, java.lang.String ns)
Returns a NodeList
of all immediate children with a given tag name and namespace
name
- The name of the tag to match on. (should be local name)
ns
- The name space
A list of matching children
public org.w3c.dom.NodeList getElementsByTagName(java.lang.String name)
Returns a NodeList
of all descendant elements with a given tag name, in the order in which they would be encountered in a preorder traversal of the Element
tree.
org.w3c.dom.Element.getElementsByTagName(String) in interface org.w3c.dom.Element
name
- The name of the tag to match on. The special value "*" matches all tags.
A list of matching Element
nodes.
public org.w3c.dom.NodeList getElementsByTagName(java.lang.String name, java.lang.String ns)
Returns a NodeList
of all descendant elements with a given tag name, and namespace in the order in which they would be encountered in a preorder traversal of the Element
tree.
name
- The name of the tag to match on. The special value "*" matches all tags. (should be local name)
ns
- The namespace of the elements
A list of matching Element
nodes.
public java.lang.String getExpandedName()
Get the fully resolved name for this element.
getExpandedName() in interface NSName
the fully resolved name
public java.lang.String getLocalName()
Get the local Name for this element.
getLocalName() in interface NSName
the local Name
public java.lang.String getNamespace()
Get the resolved Namespace for this element.
getNamespace() in interface NSName
the resolved Namespace
public java.lang.String getPrefix()
Get the namespace prefix for this element.
getPrefix() in interface NSName
the namespace prefix
public java.lang.String getQualifiedName()
Get the qualified name for this element.
getQualifiedName() in interface NSName
the qualified name
public java.lang.String getTagName()
Gets the name of the element. For example, in <elementExample id="demo"> ... </elementExample> , tagName
has the value "elementExample"
. Note that this is case-preserving in XML, as are all of the operations of the DOM. The HTML DOM returns the tagName
of an HTML element in the canonical uppercase form, regardless of the case in the source HTML document.
org.w3c.dom.Element.getTagName() in interface org.w3c.dom.Element
The element name
public void normalize()
Puts all Text
nodes in the full depth of the sub-tree underneath this Element
into a "normal" form where only markup (e.g., tags, comments, processing instructions, CDATA sections, and entity references) separates Text
nodes, i.e., there are no adjacent Text
nodes. This can be used to ensure that the DOM view of a document is the same as if it were saved and re-loaded, and is useful when operations (such as XPointer lookups) that depend on a particular doc1ument tree structure are to be used.
org.w3c.dom.Element.normalize() in interface org.w3c.dom.Element
public void removeAttribute(java.lang.String name)
Removes an attribute by name. If the removed attribute has a default value it is immediately replaced.
org.w3c.dom.Element.removeAttribute(String) in interface org.w3c.dom.Element
name
- The name of the attribute to remove.
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
public org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr oldAttr)
Removes the specified attribute.
org.w3c.dom.Element.removeAttributeNode(Attr) in interface org.w3c.dom.Element
oldAttr
- The Attr
node to remove from the attribute list. If the removed Attr
has a default value it is immediately replaced.
The Attr
node that was removed.
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. NOT_FOUND_ERR: Raised if oldAttr
is not an attribute of the element.
public java.lang.String resolveNamespacePrefix(java.lang.String prefix)
Given a namespace prefix, find the namespace definition in scope in this element.
resolveNamespacePrefix(String) in interface NSResolver
prefix
- Namespace prefix to be resolved
the resolved Namespace (null, if prefix could not be resolved)
public void setAttribute(java.lang.String name, java.lang.String value)
Adds a new attribute. If an attribute with that name is already present in the element, its value is changed to be that of the value parameter. This value is a simple string, it is not parsed as it is being set. So any markup (such as syntax to be recognized as an entity reference) is treated as literal text, and needs to be appropriately escaped by the implementation when it is written out. In order to assign an attribute value that contains entity references, the user must create an Attr
node plus any Text
and EntityReference
nodes, build the appropriate subtree, and use setAttributeNode
to assign it as the value of an attribute.
org.w3c.dom.Element.setAttribute(String, String) in interface org.w3c.dom.Element
name
- The name of the attribute to create or alter.
value
- Value to set in string form.
org.w3c.dom.DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character. NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
public org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr newAttr)
Adds a new attribute. If an attribute with that name is already present in the element, it is replaced by the new one.
org.w3c.dom.Element.setAttributeNode(Attr) in interface org.w3c.dom.Element
newAttr
- The Attr
node to add to the attribute list.
If the newAttr
attribute replaces an existing attribute with the same name, the previously existing Attr
node is returned, otherwise null
is returned.
org.w3c.dom.DOMException - WRONG_DOCUMENT_ERR: Raised if newAttr
was created from a different document than the one that created the element. NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. INUSE_ATTRIBUTE_ERR: Raised if newAttr
is already an attribute of another Element
object. The DOM user must explicitly clone Attr
nodes to re-use them in other elements.
public class XMLEntityReference extends XMLNode implements org.w3c.dom.EntityReference, oracle.xml.parser.v2.XMLConstants, java.lang.Cloneable, java.io.Serializable java.lang.Object | +--XMLNode | +--oracle.xml.parser.v2.XMLEntityReference
java.lang.Cloneable, org.w3c.dom.EntityReference, org.w3c.dom.Node, java.io.Serializable, oracle.xml.parser.v2.XMLConstants
Member Summary |
|
---|---|
Constructors |
|
|
Inherited Member Summary |
---|
Fields inherited from class XMLNode |
|
Fields inherited from interface Node |
|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Methods inherited from class XMLNode |
|
Methods inherited from class java.lang.Object |
|
Methods inherited from interface Node |
|
public XMLEntityReference(java.lang.String tag)
public class XMLNode extends java.lang.Object implements org.w3c.dom.Node, oracle.xml.parser.v2.XMLConstants, java.lang.Cloneable, java.io.Serializable java.lang.Object | +--oracle.xml.parser.v2.XMLNode
AttrDecl, oracle.xml.parser.v2.CharData, DTD, ElementDecl, XMLAttr, XMLDocument, XMLDocumentFragment, XMLElement, XMLEntityReference
java.lang.Cloneable, org.w3c.dom.Node, java.io.Serializable, oracle.xml.parser.v2.XMLConstants
Implements the DOM Node
interface and serves as the primary datatype for the entire Document Object Model. It represents a single node in the document tree.
The attributes nodeName
, nodeValue
and attributes
are included as a mechanism to get at node information without casting down to the specific derived instance. In cases where there is no obvious mapping of these attributes for a specific nodeType
(e.g., nodeValue
for an Element or attributes
for a Comment), this returns null
. Note that the derived classes may contain additional and more convenient mechanisms to get and set the relevant information.
public static final short ATTRDECL
A attribute declaration node
public static final short ELEMENTDECL
An element declaration node.
public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
Adds the node newChild
to the end of the list of children of this node. If the newChild
is already in the tree, it is first removed.
org.w3c.dom.Node.appendChild(Node) in interface org.w3c.dom.Node
newChild
- The node to add.If it is a DocumentFragment
object, the entire contents of the document fragment are moved into the child list of this node
The node added.
org.w3c.dom.DOMException - HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild
node, or if the node to append is one of this node's ancestors. WRONG_DOCUMENT_ERR: Raised if newChild
was created from a different document than the one that created this node. NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
public org.w3c.dom.Node cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent ( parentNode
returns null
.). Cloning an Element
copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child Text
node. Cloning any other type of node simply returns a copy of this node.
org.w3c.dom.Node.cloneNode(boolean) in interface org.w3c.dom.Node
deep
- If true
, recursively clone the subtree under the specified node; if false
, clone only the node itself (and its attributes, if it is an Element
).
The duplicate node.
public org.w3c.dom.NamedNodeMap getAttributes()
Gets a NamedNodeMap
containing the attributes of this node (if it is an Element
) or null
otherwise.
org.w3c.dom.Node.getAttributes() in interface org.w3c.dom.Node
the attributes of this node
public org.w3c.dom.NodeList getChildNodes()
Gets a NodeList
that contains all children of this node. If there are no children, this is a NodeList
containing no nodes. The content of the returned NodeList
is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the NodeList
accessors; it is not a static snapshot of the content of the node. This is true for every NodeList
, including the ones returned by the getElementsByTagName
method.
org.w3c.dom.Node.getChildNodes() in interface org.w3c.dom.Node
The children of this node
public org.w3c.dom.Node getFirstChild()
Gets the first child of this node. If there is no such node, this returns null
.
org.w3c.dom.Node.getFirstChild() in interface org.w3c.dom.Node
The first child of this node
public org.w3c.dom.Node getLastChild()
Gets the last child of this node. If there is no such node, this returns null
.
org.w3c.dom.Node.getLastChild() in interface org.w3c.dom.Node
The last child of this node
public org.w3c.dom.Node getNextSibling()
Gets The node immediately following this node. If there is no such node, this returns null
.
org.w3c.dom.Node.getNextSibling() in interface org.w3c.dom.Node
the next node
public java.lang.String getNodeName()
Gets the name of this node, depending on its type
org.w3c.dom.Node.getNodeName() in interface org.w3c.dom.Node
Name of this node
public short getNodeType()
Gets a code representing the type of the underlying object
org.w3c.dom.Node.getNodeType() in interface org.w3c.dom.Node
type of the node
public java.lang.String getNodeValue()
Gets the value of this node, depending on its type
org.w3c.dom.Node.getNodeValue() in interface org.w3c.dom.Node
Value of this node
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString
variable on the implementation platform.
public org.w3c.dom.Document getOwnerDocument()
Gets the Document
object associated with this node. This is also the Document
object used to create new nodes. When this node is a Document
this is null
.
org.w3c.dom.Node.getOwnerDocument() in interface org.w3c.dom.Node
The document associated with this node
public org.w3c.dom.Node getParentNode()
Gets the parent of this node. All nodes, except Document
, DocumentFragment
, and Attr
may have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is null
.
org.w3c.dom.Node.getParentNode() in interface org.w3c.dom.Node
The parent of this node
public org.w3c.dom.Node getPreviousSibling()
Gets the node immediately preceding this node. If there is no such node, this returns null
.
org.w3c.dom.Node.getPreviousSibling() in interface org.w3c.dom.Node
the previous node
public boolean hasChildNodes()
This is a convenience method to allow easy determination of whether a node has any children.
org.w3c.dom.Node.hasChildNodes() in interface org.w3c.dom.Node
true
if the node has any children, false
if the node has no children.
public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
Inserts the node newChild
before the existing child node refChild
. If refChild
is null
, insert newChild
at the end of the list of children. If newChild
is a DocumentFragment
object, all of its children are inserted, in the same order, before refChild
. If the newChild
is already in the tree, it is first removed.
org.w3c.dom.Node.insertBefore(Node, Node) in interface org.w3c.dom.Node
newChild
- The node to insert.
refChild
- The reference node, i.e., the node before which the new node must be inserted.
The node being inserted.
org.w3c.dom.DOMException - HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild
node, or if the node to insert is one of this node's ancestors. WRONG_DOCUMENT_ERR: Raised if newChild
was created from a different document than the one that created this node. NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. NOT_FOUND_ERR: Raised if refChild
is not a child of this node.
public void print(java.io.OutputStream out)
Writes the contents of this node to the given output stream.
out
- OutputStream
to write to
IOException
- if an error occurs
public void print(java.io.OutputStream out, java.lang.String enc)
Writes the contents of this node to the given output stream.
out
- OutputStream
to write to
enc
- Encoding to use for the output
IOException
- if an invalid encoding was specified or if any other error occurs
public void print(java.io.PrintWriter out)
Writes the contents of this node using the given print writer.
out
- PrintWriter
to use
IOException
- if an error occurs
public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
Removes the child node indicated by oldChild
from the list of children, and returns it.
org.w3c.dom.Node.removeChild(Node) in interface org.w3c.dom.Node
oldChild
- The node being removed.
The node removed.
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. NOT_FOUND_ERR: Raised if oldChild
is not a child of this node.
public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
Replaces the child node oldChild
with newChild
in the list of children, and returns the oldChild
node. If the newChild
is already in the tree, it is first removed.
org.w3c.dom.Node.replaceChild(Node, Node) in interface org.w3c.dom.Node
newChild
- The new node to put in the child list.
oldChild
- The node being replaced in the list.
The node replaced.
org.w3c.dom.DOMException - HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild
node, or it the node to put in is one of this node's ancestors. WRONG_DOCUMENT_ERR: Raised if newChild
was created from a different document than the one that created this node. NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. NOT_FOUND_ERR: Raised if oldChild
is not a child of this node.
public org.w3c.dom.NodeList selectNodes(java.lang.String pattern, NSResolver nsr)
Selects nodes from the tree which match the given pattern
pattern
- XSL pattern to match
nsr
- NSResolver to resolve any prefixes that occur in given pattern
a list of matching nodes
XSLException - Raised if there is an error while doing the match
public org.w3c.dom.Node selectSingleNode(java.lang.String pattern, NSResolver nsr)
Selects the first node from the tree that matches the given pattern
pattern
- XSL pattern to match
nsr
- NSResolver to resolve any prefixes that occur in given pattern
matching node
XSLException - Raised if there is an error while doing the match
public void setNodeValue(java.lang.String nodeValue)
Sets the value of this node, depending on its type
org.w3c.dom.Node.setNodeValue(String) in interface org.w3c.dom.Node
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString
variable on the implementation platform.
public org.w3c.dom.DocumentFragment transformNode(XSLStylesheet xsl)
Transforms a node in the tree using the given stylesheet
xsl
- XSLStylesheet
to be used for transformation
a document fragment
XSLException - Raised if there is an error while doing the XSL transformation.
public java.lang.String valueOf(java.lang.String pattern, NSResolver nsr)
Selects the value of the first node from the tree that matches the given pattern
pattern
- XSL pattern to match
nsr
- NSResolver to resolve any prefixes that occur in given pattern
value of the matching node
XSLException - Raised if there is an error while doing the match
public class XMLParseException extends org.xml.sax.SAXParseException java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--org.xml.sax.SAXException | +--org.xml.sax.SAXParseException | +--oracle.xml.parser.v2.XMLParseException
java.io.Serializable
Indicates that a parsing exception occurred while processing an XML document
public static final int ERROR
Code for non-fatal error
public static final int FATAL_ERROR
Code for fatal error
public static final int WARNING
Code for warning
public XMLParseException(java.lang.String mesg, java.lang.String pubId, java.lang.String sysId, int line, int col, int type)
public int getColumnNumber(int i)
Get the column number of error at specified index
The column number
public java.lang.Exception getException(int i)
Get the exception (if exists) that occured in error at specified index
The exception
public int getLineNumber(int i)
Get the line number of error at specified index
The line number
public java.lang.String getMessage(int i)
Get the error message at specified index
The error message
public int getMessageType(int i)
Get the type of the error message at specified index
The error message type
public int getNumMessages()
Return the total number of errors/warnings found during parsing
The number of errors/warnings
public java.lang.String getPublicId(int i)
Get the public ID of input when error at specified index occured
The public ID
public java.lang.String getSystemId(int i)
Get the system ID of input when error at specified index occured
The system ID
public abstract class XMLParser extends java.lang.Object implements oracle.xml.parser.v2.XMLConstants java.lang.Object | +--oracle.xml.parser.v2.XMLParser
DOMParser, SAXParser
oracle.xml.parser.v2.XMLConstants
This class serves as a base class for the DOMParser
and SAXParser
classes. It contains methods to parse eXtensible Markup Language (XML) 1.0 documents according to the World Wide Web Consortium (W3C) recommendation. This class can not be instantiated (applications may use the DOM or SAX parser depending on their requirements).
public static java.lang.String getReleaseVersion()
Returns the release version of the Oracle XML Parser
the release version string
public boolean getValidationMode()
Returns the validation mode
true
if the XML parser is validating false
if not
public final void parse(org.xml.sax.InputSource in)
Parses the XML from given input source
in
- the org.xml.sax.InputSouce
to parse
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public final void parse(java.io.InputStream in)
Parses the XML from given input stream. The base URL should be set for resolving external entities and DTD.
in
- the InputStream
containing XML data to parse.
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public final void parse(java.io.Reader r)
Parses the XML from given input stream. The base URL should be set for resolving external entities and DTD.
r
- the Reader
containing XML data to parse.
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public final void parse(java.lang.String in)
Parses the XML from the URL indicated
in
- the String
containing the URL to parse from
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public final void parse(java.net.URL url)
Parses the XML document pointed to by the given URL and creates the corresponding XML document hierarchy.
url
- the url points to the XML document to parse.
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public void setBaseURL(java.net.URL url)
Set the base URL for loading external enitites and DTDs. This method should to be called if the parse(InputStream) is used to parse the XML Document
url
- The base URL
public void setDoctype(DTD dtd)
Set the DTD
dtd
- DTD
to set and used while parsing
public void setLocale(java.util.Locale locale)
Applications can use this to set the locale for error reporting.
locale
- Locale
to set
org.xml.sax.SAXException - A SAXException
could be thrown.
org.xml.sax.Parser.setLocale(Locale)
public void setPreserveWhitespace(boolean flag)
Set the white space preserving mode
flag
- preserving mode
public void setValidationMode(boolean yes)
Set the validation mode
yes
- determines whether the XML parser should be validating
public class XMLPI extends oracle.xml.parser.v2.CharData implements org.w3c.dom.ProcessingInstruction, java.io.Serializable java.lang.Object | +--XMLNode | +--oracle.xml.parser.v2.CharData | +--oracle.xml.parser.v2.XMLPI
org.w3c.dom.CharacterData, java.lang.Cloneable, org.w3c.dom.Node, org.w3c.dom.ProcessingInstruction, java.io.Serializable, oracle.xml.parser.v2.XMLConstants
This class implements the DOM Processing Instruction interface.
org.w3c.dom.ProcessingInstruction, NodeFactory, setNodeFactory(NodeFactory)
Member Summary |
|
---|---|
Constructors |
|
Creates a new ProcessingInstruction node with the given target and the data. |
|
Methods |
|
Returns the target of this PI. |
Inherited Member Summary |
---|
Fields inherited from class XMLNode |
|
Fields inherited from interface Node |
|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Methods inherited from class oracle.xml.parser.v2.CharData |
|
Methods inherited from class XMLNode |
|
Methods inherited from class java.lang.Object |
|
Methods inherited from interface ProcessingInstruction |
|
Methods inherited from interface Node |
|
Methods inherited from interface CharacterData |
|
public XMLPI(java.lang.String target, java.lang.String data)
Creates a new ProcessingInstruction node with the given target and the data.
target
- The target of this PI
data
- The content of this PI
public java.lang.String getTarget()
Returns the target of this PI. XML defines this as the first token following markup that begins the processing instruction.
org.w3c.dom.ProcessingInstruction.getTarget() in interface org.w3c.dom.ProcessingInstruction
The target of the PI.
public class XMLText extends oracle.xml.parser.v2.CharData implements org.w3c.dom.Text, java.io.Serializable java.lang.Object | +--XMLNode | +--oracle.xml.parser.v2.CharData | +--oracle.xml.parser.v2.XMLText
XMLCDATA
org.w3c.dom.CharacterData, java.lang.Cloneable, org.w3c.dom.Node, java.io.Serializable, org.w3c.dom.Text, oracle.xml.parser.v2.XMLConstants
This class implements the DOM Text interface.
org.w3c.dom.Text, NodeFactory, setNodeFactory(NodeFactory)
Member Summary |
|
---|---|
Constructors |
|
|
|
Methods |
|
|
|
Breaks |
Inherited Member Summary |
---|
Fields inherited from class XMLNode |
|
Fields inherited from interface Node |
|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Methods inherited from class oracle.xml.parser.v2.CharData |
|
Methods inherited from class XMLNode |
|
Methods inherited from class java.lang.Object |
|
Methods inherited from interface CharacterData |
|
Methods inherited from interface Node |
|
public XMLText(java.lang.String text)
public java.lang.String getNodeValue()
org.w3c.dom.Node.getNodeValue() in interface org.w3c.dom.Node
getNodeValue() in class XMLNode
public org.w3c.dom.Text splitText(int offset)
Breaks Text
node into two Text nodes at specified offset, so they are both siblings, and the node only contains content up to the offset. New node inserted as next sibling contains all content at and after the offset point.
org.w3c.dom.Text.splitText(int) in interface org.w3c.dom.Text
offset
- Offset at which to split, starting from 0
New Text
node
org.w3c.dom.DOMException - INDEX_SIZE_ERR: Raised if specified offset is negative or greater than number of characters in data
. NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
public interface XMLToken
Basic interface for XMLToken
All XMLParser applications with Tokenizer feature must implement this interface. The interface has to be registered using XMLParser
method setTokenHandler(XMLToken handler)
.
If XMLtoken handler != null then for each registered and found token the parser calls the XMLToken call-back method token(int token, String value)
. During tokenizing the parser doesn't validate the document and doesn't include/read internal/external entities. If XMLtoken handler == null then the parser parses as usual.
A request for XML token is registered (on/off) using XMLParser method setToken (int token, boolean set)
. The requests could be registered during the parsing (from inside the call-back method) as well.
The XML tokens are defined as public constants in XMLToken
interface. They correspond to the XML syntax variables from W3C XML Syntax Specification.
public static final int AttListDecl
AttListDecl ::= '<' '!' 'ATTLIST' S Name AttDef* S? '>'
public static final int AttName
AttName ::= Name
public static final int Attribute
Attribute ::= AttName Eq AttValue
public static final int AttValue
AttValue ::= '"' ([^<&"] | Reference)* '"'
| "'" ([^<&'] | Reference)* "'"
public static final int CDSect
CDSect ::= CDStart CData CDEnd
CDStart ::= '<' '!' '[CDATA['
CData ::= (Char* - (Char* ']]>' Char*))
CDEnd ::= ']]>'
public static final int CharData
CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
public static final int Comment
Comment ::= '<' '!' '--' ((Char - '-') | ('-' (Char - '-')))* '-->'
public static final int DTDName
DTDName ::= name
public static final int ElemDeclName
ElemDeclName ::= name
public static final int elementdecl
elementdecl ::= '<' '!ELEMENT' S ElemDeclName S contentspec S? '>'
public static final int EmptyElemTag
EmptyElemTag ::= '<' STagName (S Attribute)* S? '/' '>'
public static final int EntityDecl
EntityDecl ::= '<' '!' ENTITY' S EntityDeclName S EntityDef S? '>'
| '<' '!' ENTITY' S '%' S EntityDeclName S PEDef S? '>'
EntityDef ::= EntityValue | (ExternalID NDataDecl?)
PEDef ::= EntityValue | ExternalID
public static final int EntityDeclName
EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"'
| "'" ([^%&'] | PEReference | Reference)* "'"
public static final int EntityValue
EntityDeclName ::= Name
public static final int ETag
ETag ::= '<' '/' ETagName S? '>'
public static final int ETagName
ETagName ::= Name
public static final int ExternalID
ExternalID ::= 'SYSTEM' S SystemLiteral
| 'PUBLIC' S PubidLiteral S SystemLiteral
public static final int NotationDecl
NotationDecl ::= '<' '!NOTATION' S Name S (ExternalID | PublicID) S? '>'
public static final int PI
PI ::= '<' '?' PITarget (S (Char* - (Char* '?>' Char*)))? '?' '>'
public static final int PITarget
PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
public static final int Reference
Reference ::= EntityRef | CharRef | PEReference
EntityRef ::= '&' Name ';'
PEReference ::= '%' Name ';'
CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';
public static final int STag
STag ::= '<' STagName (S Attribute)* S? '>'
public static final int STagName
STagName ::= Name
public static final int TextDecl
TextDecl ::= '<' '?' 'xml' VersionInfo? EncodingDecl S? '?>'
public static final int XMLDecl
XMLDecl ::= '<' '?' 'xml' VersionInfo EncodingDecl? SDDecl? S? '?' '>'
public void token(int token, java.lang.String value)
The interface call-back method. Receives an XML token and it's corresponding value
token
- The XML token constant as specified in the interface.
value
- The corresponding substring from the parsed text.
public class XMLTokenizer extends Package oracle.xml.parser.v2 implements oracle.xml.parser.v2.XMLConstants java.lang.Object | +--org.xml.sax.HandlerBase | +--Package oracle.xml.parser.v2 | +--oracle.xml.parser.v2.XMLTokenizer
org.xml.sax.DocumentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, oracle.xml.parser.v2.XMLConstants, XMLDocumentHandler
This class implements an eXtensible Markup Language (XML) 1.0 parser according to the World Wide Web Consortium (W3C) recommendation.
Inherited Member Summary |
---|
Fields inherited from interface oracle.xml.parser.v2.XMLConstants |
|
Methods inherited from class Package oracle.xml.parser.v2 |
|
Methods inherited from class HandlerBase |
|
Methods inherited from class java.lang.Object |
|
Methods inherited from interface XMLDocumentHandler |
|
Methods inherited from interface DocumentHandler |
|
Methods inherited from interface EntityResolver |
|
Methods inherited from interface DTDHandler |
|
Methods inherited from interface ErrorHandler |
|
public XMLTokenizer()
Creates a new Tokenizer object.
public XMLTokenizer(XMLToken handler)
Creates a new Tokenizer object.
public void parseDocument()
Document ::= Prolog Element Misc*
public void setErrorHandler(org.xml.sax.ErrorHandler handler)
Applications can use this to register a new error event handler. This replaces any previous setting for error handling.
handler
- ErrorHandler
being registered
public void setErrorStream(java.io.OutputStream out)
Register a output stream for errors
public void setToken(int token, boolean val)
Applications can use this to register a new token for XML tokenizer.
token
- XMLToken
being set
public void setTokenHandler(XMLToken handler)
Applications can use this to register a new XML tokenizer event handler.
handler
- XMLToken
being registered
public final void tokenize(org.xml.sax.InputSource in)
Tokenizes the XML from given input source
in
- the org.xml.sax.InputSouce
to parse
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public final void tokenize(java.io.InputStream in)
Tokenizes the XML from given input stream.
in
- the InputStream
containing XML data to parse.
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public final void tokenize(java.io.Reader r)
Tokenizes the XML from given input stream.
r
- the Reader
containing XML data to parse.
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public final void tokenize(java.lang.String in)
Tokenizes the XML from the URL indicated
in
- the String
containing the URL to parse from
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public final void tokenize(java.net.URL url)
Tokenizes the XML document pointed to by the given URL and creates the corresponding XML document hierarchy.
url
- the url points to the XML document to parse.
XMLParseException - if syntax or other error encountered.
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
IOException
- IO Error.
public class XSLException extends java.lang.Exception java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--oracle.xml.parser.v2.XSLException
java.io.Serializable
Indicates that an exception occurred during XSL tranformation
public class XSLProcessor extends java.lang.Object java.lang.Object | +--oracle.xml.parser.v2.XSLProcessor
This class provides methods to transform an input XML document using a previously constructed XSLStylesheet
. The transformation effected is as specified by the XSLT 1.0 specification.
Member Summary |
|
---|---|
Constructors |
|
|
|
Methods |
|
Transform input XML document using given InputStream and stylesheet. |
|
Transform input XML document using given Reader and stylesheet. |
|
Transform input XML document using given URL and stylesheet. |
|
Transform input XML document using given XMLDocument and stylesheet. |
|
Transform input XML document using given XMLDocument and stylesheet. |
|
|
Transform input XML using given XMLDocumentFragment and stylesheet. |
Transform input XML using given XMLDocumentFragment and stylesheet. |
|
Transform input XML document using given XMLDocument and stylesheet. |
|
Transform input XML document using given XMLDocument and stylesheet. |
|
Creates an output stream for the output of warnings. |
|
Applications can use this to set the locale for error reporting. |
|
Switch to determine whether to output warnings. |
Inherited Member Summary |
---|
Methods inherited from class java.lang.Object |
|
public XSLProcessor()
public XMLDocumentFragment processXSL(XSLStylesheet xsl, java.io.InputStream xml, java.net.URL ref)
Transforms input XML document using given InputStream and stylesheet.
xsl
- XSLStylesheet
to be used for transformation
xml
- XML input to be transformed (as a java.io.Inputstream)
ref
- Reference URL to resolve external entities in input xml file
XMLDocumentFragment
XSLException - on error.
public XMLDocumentFragment processXSL(XSLStylesheet xsl, java.io.Reader xml, java.net.URL ref)
Transform input XML document using given Reader and stylesheet.
xsl
- XSLStylesheet
to be used for transformation
xml
- XML input to be transformed (as a java.io.Reader)
ref
- Reference URL to resolve external entities in input xml file
XMLDocumentFragment
XSLException - on error.
public XMLDocumentFragment processXSL(XSLStylesheet xsl, java.net.URL xml, java.net.URL ref)
Transform input XML document using given URL and stylesheet.
xsl
- XSLStylesheet
to be used for transformation
xml
- XML input to be transformed (as a java.net.URL)
ref
- Reference URL to resolve external entities in input xml file
XMLDocumentFragment
XSLException - on error.
public XMLDocumentFragment processXSL(XSLStylesheet xsl, XMLDocument xml)
Transform input XML document using given XMLDocument and stylesheet.
xsl
- XSLStylesheet
to be used for transformation
xml
- XML input to be transformed (as a DOM Tree)
XMLDocumentFragment
XSLException - on error.
public XMLDocumentFragment processXSL(XSLStylesheet xsl, XMLDocumentFragment inp)
Transform input XML document using given XMLDocument and stylesheet.
xsl
- XSLStylesheet
to be used for transformation
xml
- XML input to be transformed (as a DOM Tree)
XMLDocumentFragment
XSLException - on error.
public void processXSL(XSLStylesheet xsl, XMLDocumentFragment xml, java.io.OutputStream out)
Transform input XML using given XMLDocumentFragment and stylesheet.
xsl
- XSLStylesheet
to be used for transformation
xml
- XML input to be transformed (as a DOM Tree)
out
- Outputstream to which the result is printed
XSLException,
- IOException on error.
public void processXSL(XSLStylesheet xsl, XMLDocumentFragment xml, java.io.PrintWriter pw)
Transform input XML using given XMLDocumentFragment and stylesheet.
xsl
- XSLStylesheet
to be used for transformation
xml
- XML input to be transformed (as a DOM Tree)
pw
- PrintWriter to which the result is printed
XSLException,
- IOException on error.
public void processXSL(XSLStylesheet xsl, XMLDocument xml, java.io.OutputStream out)
Transform input XML document using given XMLDocument and stylesheet.
xsl
- XSLStylesheet
to be used for transformation
xml
- XML input to be transformed (as a DOM Tree)
out
- Outputstream to which the result is printed
XSLException,
- IOException on error.
public void processXSL(XSLStylesheet xsl, XMLDocument xml, java.io.PrintWriter pw)
Transform input XML document using given XMLDocument and stylesheet.
xsl
- XSLStylesheet
to be used for transformation
xml
- XML input to be transformed (as a DOM Tree)
pw
- PrintWriter to which the result is printed
XSLException,
- IOException on error.
public final void setErrorStream(java.io.OutputStream out)
Creates an output stream for the output of warnings. If an output stream for warnings is not specified, the processor will not output any warnings
out
- The output stream to use for errors and warnings
public void setLocale(java.util.Locale locale)
Applications can use this to set the locale for error reporting.
locale
- Locale
to set
public final void showWarnings(boolean yes)
Switch to determine whether to output warnings.
yes
- determines whether warnings should be shown By default, warnings are not output
public class XSLStylesheet extends java.lang.Object implements oracle.xml.parser.v2.XSLConstants java.lang.Object | +--oracle.xml.parser.v2.XSLStylesheet
oracle.xml.parser.v2.XSLConstants
The class holds XSL stylesheet information such as templates, keys, variables, and attribute sets. The same stylesheet, once constructed, can be used to transform multiple XML documents.
public XSLStylesheet(java.io.InputStream xsl, java.net.URL ref)
Constructs an XSLStylesheet using the given Inputstream
xsl
- XSL input as an Inputstream
ref
- Reference URL for include, import and external entities
XSLException - on error.
public XSLStylesheet(java.io.Reader xsl, java.net.URL ref)
Constructs an XSLStylesheet using the given Reader
xsl
- XSL input as a Reader
ref
- Reference URL for include, import and external entities
XSLException - on error.
public XSLStylesheet(java.net.URL xsl, java.net.URL ref)
Constructs an XSLStylesheet using the given URL
xsl
- XSL input as a URL
ref
- Reference URL for include, import and external entities
XSLException - on error.
public XSLStylesheet(XMLDocument xsl, java.net.URL ref)
Constructs an XSLStylesheet using the given XMLDocument
xsl
- XSL input as a DOM Tree
ref
- Reference URL for include, import
XSLException - on error.
public void setParam(java.lang.String name, java.lang.String value)
Sets the value of a top-level stylesheet parameter. The parameter value is expected to be a valid XPath expression (note that string literal values would therefore have to be explicitly quoted).
name
- parameter name
value
- parameter value as an XPath expression
XSLException - on error
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|