|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.icl.saxon.om.Navigator
Navigator provides helper classes for navigating a tree, irrespective of its implementation
Constructor Summary | |
Navigator()
|
Method Summary | |
static java.lang.String |
alphaKey(int value)
Construct an alphabetic key from an positive integer; the key collates in the same sequence as the integer |
static ElementInfo |
getAncestor(NodeInfo node,
NodeTest test)
Get the nearest ancestor element with a given name |
static NodeInfo |
getAncestor(NodeInfo node,
Pattern pat,
Context c)
Get the nearest ancestor node that matches the given pattern |
static java.lang.String[] |
getAssociatedStylesheets(DocumentInfo doc,
java.lang.String media,
java.lang.String title)
Get the URIs of the stylesheet associated with this document by means of an xml-stylesheet processing instruction. |
static NodeInfo |
getFirstChild(NodeInfo node,
Pattern pattern,
Context c)
Get the first child node matching a given pattern |
static NodeInfo |
getLastChild(NodeInfo node,
Pattern pattern,
Context c)
Get the last child node matching a given pattern |
static NodeInfo |
getNextSibling(NodeInfo node,
Pattern pattern,
Context c)
Get the next sibling node that matches a given pattern. |
static java.lang.String |
getNodeTypeName(int type)
Translate numeric node type to a string representation |
static int |
getNumberAny(NodeInfo node,
Pattern count,
Pattern from,
Context context)
Get node number (level="any"). |
static java.util.Vector |
getNumberMulti(NodeInfo node,
Pattern count,
Pattern from,
Context context)
Get node number (level="multiple"). |
static int |
getNumberSimple(NodeInfo node)
Get simple node number. |
static int |
getNumberSimple(NodeInfo node,
Context context)
Get simple node number. |
static int |
getNumberSingle(NodeInfo node,
Pattern count,
Pattern from,
Context context)
Get node number (level="single"). |
static NodeInfo |
getPreviousInDocument(NodeInfo node,
Pattern pattern,
Context c)
Get the previous node in document order |
static NodeInfo |
getPreviousSibling(NodeInfo node,
Pattern pattern,
Context c)
Get the previous sibling of the node that matches a given pattern. |
static boolean |
isAncestor(NodeInfo node,
NodeInfo other)
Determine whether this node is an ancestor of another node |
static boolean |
isFirstChild(ElementInfo element)
Determine whether this element is the first element child of its parent. |
static boolean |
isFirstInGroup(ElementInfo element)
Determine whether this element is the first in a consecutive group. |
static boolean |
isLastChild(ElementInfo element)
Determine whether this element is the last child element of its parent. |
static boolean |
isLastInGroup(ElementInfo element)
Determine whether this element is the last in a consecutive group. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Navigator()
Method Detail |
public static java.lang.String[] getAssociatedStylesheets(DocumentInfo doc, java.lang.String media, java.lang.String title) throws org.xml.sax.SAXException
media
- The required medium, or null to match any mediumtitle
- The required title, or null to match the preferred stylesheetorg.xml.sax.SAXException
- if there is such a processing instruction and it is invalidpublic static boolean isFirstInGroup(ElementInfo element)
element
- The element being testedpublic static boolean isLastInGroup(ElementInfo element)
element
- The element being testedpublic static boolean isFirstChild(ElementInfo element)
element
- The element being testedpublic static boolean isLastChild(ElementInfo element)
element
- The element being testedpublic static ElementInfo getAncestor(NodeInfo node, NodeTest test)
node
- The starting nodetest
- NodeTest that the required ancestor must satisfy.public static NodeInfo getAncestor(NodeInfo node, Pattern pat, Context c) throws org.xml.sax.SAXException
node
- The starting nodepattern
- A pattern that the ancestor node must satisfy.public static boolean isAncestor(NodeInfo node, NodeInfo other)
node
- the putative ancestor nodeother
- the other node (the putative descendant of this node)public static NodeInfo getNextSibling(NodeInfo node, Pattern pattern, Context c) throws org.xml.sax.SAXException
node
- The starting nodepattern
- The match-pattern that the required sibling must matchpublic static NodeInfo getFirstChild(NodeInfo node, Pattern pattern, Context c) throws org.xml.sax.SAXException
node
- The starting nodepattern
- the pattern to be matchedpublic static NodeInfo getPreviousSibling(NodeInfo node, Pattern pattern, Context c) throws org.xml.sax.SAXException
node
- The starting nodepattern
- The match-pattern that the required sibling must matchpublic static NodeInfo getPreviousInDocument(NodeInfo node, Pattern pattern, Context c) throws org.xml.sax.SAXException
node
- the starting nodepattern:
- identifies a pattern the required nodepublic static NodeInfo getLastChild(NodeInfo node, Pattern pattern, Context c) throws org.xml.sax.SAXException
node
- the starting nodepattern
- the pattern to be matchedpublic static int getNumberSimple(NodeInfo node, Context context) throws org.xml.sax.SAXException
context
- Used for remembering previous result, for performancepublic static int getNumberSimple(NodeInfo node)
public static int getNumberSingle(NodeInfo node, Pattern count, Pattern from, Context context) throws org.xml.sax.SAXException
count
- Pattern that identifies which nodes should be counted. Default (null) is the element
name if the current node is an element, or "node()" otherwise.from
- Pattern that specifies where counting starts from. Default (null) is the root node.
(This parameter does not seem useful but is included for the sake of XSLT conformance.)public static int getNumberAny(NodeInfo node, Pattern count, Pattern from, Context context) throws org.xml.sax.SAXException
count
- Pattern that identifies which nodes should be counted. Default (null) is the element
name if the current node is an element, or "node()" otherwise.from
- Pattern that specifies where counting starts from. Default (null) is the root node.
Only nodes after the first (most recent) node that matches the 'from' pattern are counted.public static java.util.Vector getNumberMulti(NodeInfo node, Pattern count, Pattern from, Context context) throws org.xml.sax.SAXException
count
- Pattern that identifies which nodes (ancestors and their previous siblings)
should be counted. Default (null) is the element
name if the current node is an element, or "node()" otherwise.from
- Pattern that specifies where counting starts from. Default (null) is the root node.
Only nodes below the first (most recent) node that matches the 'from' pattern are counted.public static java.lang.String getNodeTypeName(int type)
public static java.lang.String alphaKey(int value)
value
- The positive integer key value (negative values are treated as zero).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |