public abstract class SaplingNode extends java.lang.Object
XdmNodefor further processing, or it can be sent to a destination such as a
SaplingDocument node at the root of a constructed tree implements the JAXP
which is widely accepted by a variety of interfaces in Saxon: this means that it can readily be used as
input to a query, a transformation, a document builder, or a schema validator.
Sapling nodes are immutable objects; operations such as
SaplingElement.withChild(net.sf.saxon.sapling.SaplingNode...) create a
new object and leave the original unchanged. This eliminates the need (found in other models such as
the DOM) to make copies of nodes when attaching them to a tree.
The data model supported by Sapling nodes is close to the XDM model, but with some limitations:
xml:baseattributes; only document nodes have their own base URI
Attributes are not represented as nodes in their own right, but rather as properties of element nodes.
The internal representation of document and element nodes include a list of the node's children; but there are no links back from a node to its parent. This enables a node to be attached as a child to many different parents. This does not create problems, because nodes are immutable, and there are no operations that depend on concepts of node identity or document order.
As in XDM, an element node contains a set of in-scope namespaces. There is no requirement that the in-scope namespaces of an element should be in any way related to those of its child or parent elements. Operations that construct a regular tree from a sapling tree will introduce namespace inheritance, whereby namespaces defined on a parent element are inherited by its children. Namespace bindings for the (prefix, URI) pairs used in the names of elements and attributes are added to an element automatically; additional namespace bindings may be added by explicit API request.
|Constructor and Description|
|Modifier and Type||Method and Description|
Send a sequence of events representing this node to a supplied Receiver
Get the kind of node (document, element, text, comment, or processing instruction)
public abstract int getNodeKind()
Type.ELEMENTfor an element node.
public abstract void deliver(Receiver receiver, ParseOptions options) throws XPathException
receiver- the receiver to which the events are to be sent
options- parse options (currently ignored)
XPathException- if the receiver throws an exception
Copyright (c) 2004-2021 Saxonica Limited. All rights reserved.