com.jclark.xsl.om

Interface Node

public interface Node extends SourceLocator

represents a Node in an XML document
Field Summary
static byteALLTYPES
static byteATTRIBUTE
static byteCOMMENT
static byteELEMENT
static byteNAMESPACE
static intN_TYPES
static bytePROCESSING_INSTRUCTION
static byteROOT
static byteTEXT
Method Summary
intcompareTo(Node node)
also compares document order
NodegetAttribute(Name name)
does this only work on Elements?
SafeNodeIteratorgetAttributes()
does this only work on Elements?
StringgetAttributeValue(Name name)
does this only work on Elements?
SafeNodeIteratorgetChildren()
as the name implies ...
StringgetData()
Returns text for TEXT node; value for attribute node; content for comment node; content after PI for PI node;
NodegetElementWithId(String id)
finds an Element Node, in the this node's document, with the given ID
SafeNodeIteratorgetFollowingSiblings()
as the name implies ...
StringgetGeneratedId()
guaranteed to be unique (and repeatable)
intgetLineNumber()
if decorated with locator events, this returns the line number in the XML source where this node was found
NamegetName()
Returns element type name for element; attribute name for an attribute; target for a PI., Namespace prefix for a Namespace
NamespacePrefixMapgetNamespacePrefixMap()
in-scope namespaces ?
SafeNodeIteratorgetNamespaces()
does this only work on Elements?
NodegetParent()
as the name implies ...
NodegetRoot()
gets the owning Document's root
bytegetType()
returns one of: ELEMENT, TEXT, ATTRIBUTE, ROOT, PROCESSING_INSTRUCTION or COMMENT
StringgetUnparsedEntityURI(String name)
URLgetURL()
base URL ?
booleanisId(String id)
if this is an attribute?

Field Detail

ALLTYPES

public static byte ALLTYPES

ATTRIBUTE

public static byte ATTRIBUTE

COMMENT

public static byte COMMENT

ELEMENT

public static byte ELEMENT

NAMESPACE

public static byte NAMESPACE

N_TYPES

public static int N_TYPES

PROCESSING_INSTRUCTION

public static byte PROCESSING_INSTRUCTION

ROOT

public static byte ROOT

TEXT

public static byte TEXT

Method Detail

compareTo

public int compareTo(Node node)
also compares document order

UNKNOWN: ?? -1 if precedes, +1 if follows?

getAttribute

public Node getAttribute(Name name)
does this only work on Elements?

getAttributes

public SafeNodeIterator getAttributes()
does this only work on Elements?

getAttributeValue

public String getAttributeValue(Name name)
does this only work on Elements?

getChildren

public SafeNodeIterator getChildren()
as the name implies ...

getData

public String getData()
Returns text for TEXT node; value for attribute node; content for comment node; content after PI for PI node;

getElementWithId

public Node getElementWithId(String id)
finds an Element Node, in the this node's document, with the given ID

getFollowingSiblings

public SafeNodeIterator getFollowingSiblings()
as the name implies ...

getGeneratedId

public String getGeneratedId()
guaranteed to be unique (and repeatable)

getLineNumber

public int getLineNumber()
if decorated with locator events, this returns the line number in the XML source where this node was found

getName

public Name getName()
Returns element type name for element; attribute name for an attribute; target for a PI., Namespace prefix for a Namespace

getNamespacePrefixMap

public NamespacePrefixMap getNamespacePrefixMap()
in-scope namespaces ??

getNamespaces

public SafeNodeIterator getNamespaces()
does this only work on Elements?

getParent

public Node getParent()
as the name implies ...

getRoot

public Node getRoot()
gets the owning Document's root

getType

public byte getType()
returns one of: ELEMENT, TEXT, ATTRIBUTE, ROOT, PROCESSING_INSTRUCTION or COMMENT

getUnparsedEntityURI

public String getUnparsedEntityURI(String name)

getURL

public URL getURL()
base URL ??

isId

public boolean isId(String id)
if this is an attribute?? and it is of type ID ?