PhoenixmlDb.XQuery
INodeBuilder
Extended node store with node creation capabilities. Adds ID allocation, node registration, and namespace interning for functions that construct new XDM trees (e.g., fn:parse-xml, fn:json-to-xml).
#INodeBuilder
Namespace: PhoenixmlDb.XQuery
Extended node store with node creation capabilities. Adds ID allocation, node registration, and namespace interning for functions that construct new XDM trees (e.g.,
fn:parse-xml
,
fn:json-to-xml
).
#Methods
#AllocateDocumentId
Allocates a new unique
for a tree the caller builds and registers itself (the annotating parse of a validated document). Documents sharing an id are indistinguishable to a lookup by document, so each tree needs its own. The default derives one from a fresh node id, tagged with the high bit so it cannot meet an id a store numbers from 1.
#AllocateId
Allocates a new unique
.
#InternNamespace(String)
Interns a namespace URI, returning a stable
for it. If the URI has already been interned, returns the existing ID.
Parameters:
-
uri— The namespace URI to intern.
Returns: The interned namespace identifier.
#InternNamespace(String,PhoenixmlDb.Core.NamespaceId)
Interns a namespace URI with a hint at the desired
. If the URI is already interned, returns the existing ID. Otherwise, the store may honor
(typically allocated by static analysis before the runtime store was instantiated) so that pre-assigned IDs round-trip through serialization. If
is
or unusable, the store allocates a fresh ID.
Parameters:
-
uri— The namespace URI to intern. -
preferredId— A pre-allocated ID the store may adopt for this URI.
Returns: The ID actually used by the store — callers must use this value, not preferredId.
#RegisterNode(PhoenixmlDb.Xdm.Nodes.XdmNode)
Registers a node in the store, making it resolvable via
.
Parameters:
-
node— The node to register.
#ReserveIdsThrough(PhoenixmlDb.Core.NodeId)
Marks every node id up to and including
as used, after a parser has numbered a tree's nodes itself from one allocated start id. Without it the next allocation lands inside that tree and its nodes overwrite the first tree's. The default allocates until past
, which suits a monotonic allocator.