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

public interface GNode extends Item
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 Details

    • getNodeKind

      int getNodeKind()
    • iterateAncestorAxis

      default SequenceIterator iterateAncestorAxis(NodePredicate predicate)
      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

      default SequenceIterator iterateAncestorOrSelfAxis(NodePredicate predicate)
      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

      default SequenceIterator iterateAttributeAxis(NodePredicate predicate)
      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

      SequenceIterator iterateChildAxis(NodePredicate predicate)
      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

      default SequenceIterator iterateDescendantAxis(NodePredicate predicate)
      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

      default SequenceIterator iterateDescendantOrSelfAxis(NodePredicate predicate)
      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

      default SequenceIterator iterateFollowingAxis(NodePredicate predicate)
      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

      default SequenceIterator iterateFollowingOrSelfAxis(NodePredicate predicate)
      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

      SequenceIterator iterateFollowingSiblingAxis(NodePredicate predicate)
      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

      default SequenceIterator iterateFollowingSiblingOrSelfAxis(NodePredicate predicate)
      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

      default SequenceIterator iterateNamespaceAxis(NodePredicate predicate)
      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

      default SequenceIterator iterateParentAxis(NodePredicate predicate)
      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

      default SequenceIterator iteratePrecedingAxis(NodePredicate predicate)
      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

      default SequenceIterator iteratePrecedingOrSelfAxis(NodePredicate predicate)
      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

      SequenceIterator iteratePrecedingSiblingAxis(NodePredicate predicate)
      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

      default SequenceIterator iteratePrecedingSiblingOrSelfAxis(NodePredicate predicate)
      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

      default SequenceIterator iterateSelfAxis(NodePredicate predicate)
      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

      int compareOrder(GNode other)
      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

      void generateId(StringBuilder buffer)
      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