com.caucho.xml
Interface CauchoNode

All Superinterfaces:
Node
All Known Subinterfaces:
CauchoDocument, CauchoElement
All Known Implementing Classes:
com.caucho.xml.QAbstractNode

public interface CauchoNode
extends Node

CauchoNode extends the DOM, providing namespace support and input file support.

Application can print the filename and line number where the error occurred.


Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Method Summary
 boolean checkValid()
          For testing...
 java.lang.String getCanonicalName()
          Returns the node's canonical name.
 int getColumn()
          Returns the source column of this node.
 java.lang.String getFilename()
          Returns the source filename of this node.
 int getLine()
          Returns the source line of this node.
 java.lang.String getLocalName()
          Returns the local part of the qualified name of this node.
 java.lang.String getNamespaceURI()
          The namespace URI of this node, or null if it is unspecified.
 java.lang.String getPrefix()
          The namespace prefix of this node, or null if it is unspecified.
 java.lang.String getTextValue()
          Returns the text value of the node
 void print(WriteStream os)
          Prints the node to a stream
 void printHtml(WriteStream os)
          Prints the node as html to a stream
 void printPretty(WriteStream os)
          Pretty-prints the node to a stream
 void setLocation(java.lang.String filename, int line, int column)
          Sets the location
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Method Detail

getNamespaceURI

public java.lang.String getNamespaceURI()
Description copied from interface: Node
The namespace URI of this node, or null if it is unspecified.
This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time.
For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is always null.Per the Namespaces in XML Specification an attribute does not inherit its namespace from the element it is attached to. If an attribute is not explicitly given a namespace, it simply has no namespace.
Specified by:
getNamespaceURI in interface Node

getPrefix

public java.lang.String getPrefix()
Description copied from interface: Node
The namespace prefix of this node, or null if it is unspecified.
Note that setting this attribute, when permitted, changes the nodeName attribute, which holds the qualified name, as well as the tagName and name attributes of the Element and Attr interfaces, when applicable.
Note also that changing the prefix of an attribute that is known to have a default value, does not make a new attribute with the default value and the original prefix appear, since the namespaceURI and localName do not change.
For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is always null.
Specified by:
getPrefix in interface Node
Following copied from interface: org.w3c.dom.Node
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified prefix contains an illegal character.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NAMESPACE_ERR: Raised if the specified prefix is malformed, if the namespaceURI of this node is null, if the specified prefix is "xml" and the namespaceURI of this node is different from " http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from " http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns" .

getLocalName

public java.lang.String getLocalName()
Description copied from interface: Node
Returns the local part of the qualified name of this node.
For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is always null.
Specified by:
getLocalName in interface Node

getCanonicalName

public java.lang.String getCanonicalName()
Returns the node's canonical name.

e.g. for foo:bar:baz, the prefix name might be '{/caucho/1.0}baz'


getTextValue

public java.lang.String getTextValue()
Returns the text value of the node

getFilename

public java.lang.String getFilename()
Returns the source filename of this node.

getLine

public int getLine()
Returns the source line of this node.

getColumn

public int getColumn()
Returns the source column of this node.

setLocation

public void setLocation(java.lang.String filename,
                        int line,
                        int column)
Sets the location

print

public void print(WriteStream os)
           throws java.io.IOException
Prints the node to a stream

printPretty

public void printPretty(WriteStream os)
                 throws java.io.IOException
Pretty-prints the node to a stream

printHtml

public void printHtml(WriteStream os)
               throws java.io.IOException
Prints the node as html to a stream

checkValid

public boolean checkValid()
                   throws java.lang.Exception
For testing...