Package net.sf.saxon.om
Interface GNode
- All Superinterfaces:
GroundedValue,Item,Sequence
- All Known Subinterfaces:
MutableNodeInfo,NodeInfo,SiblingCountingNode,SteppingNode,VirtualNode
- All Known Implementing Classes:
AbsentExtensionElement,AbstractNodeWrapper,AbstractVirtualNode,AnnotationParent,AttributeImpl,AxiomAttributeWrapper,AxiomDocumentNodeWrapper,AxiomElementNodeWrapper,AxiomLeafNodeWrapper,AxiomParentNodeWrapper,ChildJNode,CommentImpl,DataElement,DocumentImpl,DOM4JNodeWrapper,DominoAttr,DominoNode,DOMNodeWrapper,ElementImpl,ExtensionInstruction,FleetingDocumentNode,FleetingElementNode,FleetingNode,FleetingParentNode,IXSLPromise,IXSLRemoveAttribute,IXSLRemoveProperty,IXSLScheduleAction,IXSLSetAttribute,IXSLSetProperty,IXSLSetStyle,JDOM2NodeWrapper,JNode,JNodeForArrayMember,JNodeForMapEntry,LiteralResultElement,NamespaceNode,NodeImpl,Orphan,ParentNodeImpl,ProcInstImpl,RebasedNode,RootJNode,SaxonAssign,SaxonChange,SaxonDeepUpdate,SaxonDelete,SaxonDo,SaxonDoctype,SaxonEntityRef,SaxonImportQuery,SaxonInsert,SaxonParam,SaxonPreprocess,SaxonRename,SaxonReplace,SaxonUpdate,SaxonWhile,SchemaElement,SnapshotNode,SpaceStrippedNode,SQLClose,SQLColumn,SQLConnect,SQLDelete,SQLExecute,SQLInsert,SQLQuery,SQLUpdate,StyleElement,TextFragmentValue,TextImpl,TextValueTemplateNode,TinyAttributeImpl,TinyDocumentImpl,TinyElementImpl,TinyNodeImpl,TinyParentNodeImpl,TinyTextImpl,TinyTextualElement,TinyTextualElement.TinyTextualElementText,TypeStrippedNode,UnknownElement,VirtualCopy,VirtualUntypedCopy,WhitespaceTextImpl,XOMDocumentWrapper,XOMNodeWrapper,XSDAlternative,XSDAnnotation,XSDAny,XSDAnyAttribute,XSDAssert,XSDAttribute,XSDAttributeGroup,XSDComplexContent,XSDComplexContentRestriction,XSDComplexType,XSDCompositor,XSDDefaultOpenContent,XSDDocumentation,XSDElement,XSDExtension,XSDFacet,XSDFieldOrSelector,XSDGroup,XSDIdentityConstraint,XSDImport,XSDInclude,XSDList,XSDNotation,XSDOpenContent,XSDOverride,XSDRedefine,XSDSchemaElement,XSDSimpleContent,XSDSimpleContentRestriction,XSDSimpleType,XSDSimpleTypeRestriction,XSDUnion,XSLAccept,XSLAcceptExpose,XSLAccumulator,XSLAccumulatorRule,XSLAnalyzeString,XSLApplyImports,XSLApplyTemplates,XSLArray,XSLArrayMember,XSLAssert,XSLAttribute,XSLAttributeSet,XSLBreak,XSLBreakOrContinue,XSLCallTemplate,XSLCatch,XSLCharacterMap,XSLChoose,XSLChooseOrSwitch,XSLComment,XSLContextItem,XSLCopy,XSLCopyOf,XSLDecimalFormat,XSLDocument,XSLElement,XSLEvaluate,XSLExpose,XSLFallback,XSLForEach,XSLForEachGroup,XSLFork,XSLFunction,XSLGeneralIncorporate,XSLGeneralVariable,XSLGlobalContextItem,XSLGlobalParam,XSLGlobalVariable,XSLIf,XSLImport,XSLImportSchema,XSLImportSchemaEE,XSLInclude,XSLItemType,XSLIterate,XSLKey,XSLLeafNodeConstructor,XSLLocalParam,XSLLocalVariable,XSLMap,XSLMapEntry,XSLMatchingSubstring,XSLMerge,XSLMergeAction,XSLMergeKey,XSLMergeSource,XSLMessage,XSLMode,XSLModuleRoot,XSLNamespace,XSLNamespaceAlias,XSLNextIteration,XSLNextMatch,XSLNumber,XSLOnCompletion,XSLOnEmpty,XSLOnNonEmpty,XSLOtherwise,XSLOutput,XSLOutputCharacter,XSLOverride,XSLPackage,XSLPerformSort,XSLPreserveSpace,XSLProcessingInstruction,XSLRecord,XSLResultDocument,XSLSelect,XSLSequence,XSLSort,XSLSortOrMergeKey,XSLSourceDocument,XSLStylesheet,XSLSwitch,XSLTemplate,XSLText,XSLTry,XSLUsePackage,XSLValueOf,XSLWhen,XSLWherePopulated,XSLWithParam
A generalized node: that is, an XNode or JNode. New in 4.0. The GNode class itself is abstract,
as is the underlying XDM type: every GNode is either an XNode or a JNode.
This class contains default implementations of all the axes except parent, child, following-sibling, preceding-sibling, attribute, and namespace.
-
Method Summary
Modifier and TypeMethodDescriptionintcompareOrder(GNode other) Compare document order of this node against another node.voidgenerateId(StringBuilder buffer) Construct a character string that uniquely identifies this node.intGet the parent of this nodebooleanAsk whether the node has childrendefault SequenceIteratoriterateAncestorAxis(NodePredicate predicate) Get an iterator over the ancestor axis, starting at this node; the nodes will be in reverse document order.default SequenceIteratoriterateAncestorOrSelfAxis(NodePredicate predicate) Get an iterator over the ancestor-or-self axis, starting at this node; the nodes will be in reverse document order.default SequenceIteratoriterateAttributeAxis(NodePredicate predicate) Get an iterator over the attribute axis, starting at this node; the nodes will be in document order.iterateChildAxis(NodePredicate predicate) Get an iterator over the child axis, starting at this node; the nodes will be in document order.default SequenceIteratoriterateDescendantAxis(NodePredicate predicate) Get an iterator over the descendant axis, starting at this node; the nodes will be in document order.default SequenceIteratoriterateDescendantOrSelfAxis(NodePredicate predicate) Get an iterator over the descendant-or-self axis, starting at this node; the nodes will be in document order.default SequenceIteratoriterateFollowingAxis(NodePredicate predicate) Get an iterator over the following axis, starting at this node; the nodes will be in document order.default SequenceIteratoriterateFollowingOrSelfAxis(NodePredicate predicate) Get an iterator over the following-or-self axis, starting at this node; the nodes will be in document order.iterateFollowingSiblingAxis(NodePredicate predicate) Get an iterator over the following-sibling axis, starting at this node; the nodes will be in document order.default SequenceIteratoriterateFollowingSiblingOrSelfAxis(NodePredicate predicate) Get an iterator over the following-sibling-or-self axis, starting at this node; the nodes will be in document order.default SequenceIteratoriterateNamespaceAxis(NodePredicate predicate) Get an iterator over the namespace axis, starting at this node; the nodes will be in reverse document order.default SequenceIteratoriterateParentAxis(NodePredicate predicate) Get an iterator over the parent axis, starting at this node; returns zero or one nodesdefault SequenceIteratoriteratePrecedingAxis(NodePredicate predicate) Get an iterator over the preceding axis, starting at this node; the nodes will be in reverse document order.default SequenceIteratoriteratePrecedingOrSelfAxis(NodePredicate predicate) Get an iterator over the preceding-or-self axis, starting at this node; the nodes will be in reverse document order.iteratePrecedingSiblingAxis(NodePredicate predicate) Get an iterator over the preceding-sibling axis, starting at this node; the nodes will be in reverse document order.default SequenceIteratoriteratePrecedingSiblingOrSelfAxis(NodePredicate predicate) Get an iterator over the preceding-sibling-or-self axis, starting at this node; the nodes will be in reverse document order.default SequenceIteratoriterateSelfAxis(NodePredicate predicate) Get an iterator over the self axis, starting at this node; there will be zero or one nodes.Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, effectiveBooleanValue, materializeMethods inherited from interface net.sf.saxon.om.Item
atomize, getGenre, getLabel, getLength, getStringValue, getUnicodeStringValue, head, isStreamed, itemAt, iterate, reduce, subsequence, toShortStringMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Method Details
-
getNodeKind
int getNodeKind() -
iterateAncestorAxis
Get an iterator over the ancestor axis, starting at this node; the nodes will be in reverse document order.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateAncestorOrSelfAxis
Get an iterator over the ancestor-or-self axis, starting at this node; the nodes will be in reverse document order.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateAttributeAxis
Get an iterator over the attribute axis, starting at this node; the nodes will be in document order.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateChildAxis
Get an iterator over the child axis, starting at this node; the nodes will be in document order.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateDescendantAxis
Get an iterator over the descendant axis, starting at this node; the nodes will be in document order.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateDescendantOrSelfAxis
Get an iterator over the descendant-or-self axis, starting at this node; the nodes will be in document order.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateFollowingAxis
Get an iterator over the following axis, starting at this node; the nodes will be in document order.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateFollowingOrSelfAxis
Get an iterator over the following-or-self axis, starting at this node; the nodes will be in document order.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateFollowingSiblingAxis
Get an iterator over the following-sibling axis, starting at this node; the nodes will be in document order.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateFollowingSiblingOrSelfAxis
Get an iterator over the following-sibling-or-self axis, starting at this node; the nodes will be in document order.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateNamespaceAxis
Get an iterator over the namespace axis, starting at this node; the nodes will be in reverse document order. The default implementation must be overridden for classes that implement element nodes.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateParentAxis
Get an iterator over the parent axis, starting at this node; returns zero or one nodes- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iteratePrecedingAxis
Get an iterator over the preceding axis, starting at this node; the nodes will be in reverse document order.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iteratePrecedingOrSelfAxis
Get an iterator over the preceding-or-self axis, starting at this node; the nodes will be in reverse document order.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iteratePrecedingSiblingAxis
Get an iterator over the preceding-sibling axis, starting at this node; the nodes will be in reverse document order.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iteratePrecedingSiblingOrSelfAxis
Get an iterator over the preceding-sibling-or-self axis, starting at this node; the nodes will be in reverse document order.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateSelfAxis
Get an iterator over the self axis, starting at this node; there will be zero or one nodes.- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
getParent
GNode getParent()Get the parent of this node- Returns:
- the parent node if there is one, or null otherwise
-
hasChildNodes
boolean hasChildNodes()Ask whether the node has children- Returns:
- true if the node has children
-
compareOrder
Compare document order of this node against another node.The other node must always be in the same tree; the effect of calling this method when the two nodes are in different trees is undefined. To obtain a global ordering of nodes, the application should first compare the result of getDocumentNumber(), and only if the document number is the same should compareOrder() be called.
- Parameters:
other- the other node- Returns:
- -1 if this node precedes the other, 0 if they are the same node, +1 if this node follows the other
-
generateId
Construct a character string that uniquely identifies this node. Note: a.isSameNode(b) if and only if generateId(a)==generateId(b)- Parameters:
buffer- a buffer which will be updated to hold a string that uniquely identifies this node, across all documents.- Since:
- 8.7
Changed in Saxon 8.7 to generate the ID value in a client-supplied buffer
-