@designliquido/xpath
    Preparing search index...

    Interface StreamingContext

    Extended context for streaming evaluation

    interface StreamingContext {
        node?: XPathNode;
        position?: number;
        size?: number;
        nodeList?: XPathNode[];
        variables?: XPathVariables;
        functions?: XPathFunctions;
        namespaces?: XPathNamespaces;
        xsltVersion?: string;
        xpathVersion?: "1.0" | "2.0" | "3.0" | "3.1";
        xpath10CompatibilityMode?: boolean;
        defaultCollation?: string;
        baseUri?: string;
        implicitTimezone?: string;
        extensions?: Record<string, any>;
        currentDateTime?: Date;
        availableDocuments?: XPathDocuments;
        availableCollections?: XPathCollections;
        defaultCollection?: string;
        functionRegistry?: XPathFunctionRegistry;
        streaming?: StreamingConfig;
        streamingBuffer?: StreamingBuffer;
        streamingStats?: StreamingStats;
        streamingDepth?: number;
        isStreaming?: boolean;
    }

    Hierarchy (View Summary)

    Index

    Properties

    node?: XPathNode

    The current context node being evaluated.

    position?: number

    The position of the context node within the current node set (1-based). Used by position() function and numeric predicates.

    size?: number

    The size of the current node set. Used by last() function.

    nodeList?: XPathNode[]

    The full node list for the current context. Used by the 'self-and-siblings' axis (XSLT-specific).

    variables?: XPathVariables

    Variable bindings available during evaluation. Variables are referenced in XPath as $variableName.

    functions?: XPathFunctions

    Custom functions available during evaluation. These extend the built-in XPath 1.0 function library.

    namespaces?: XPathNamespaces

    Namespace bindings for resolving prefixes in XPath expressions. Maps namespace prefixes to namespace URIs. Example: { "atom": "http://www.w3.org/2005/Atom" }

    xsltVersion?: string

    XSLT version ('1.0', '2.0', '3.0') for version-specific behavior. Used by functions like json-to-xml() which are only available in XSLT 3.0+

    xpathVersion?: "1.0" | "2.0" | "3.0" | "3.1"

    XPath specification version being used. Default: '1.0'

    This affects:

    • Function library available
    • Type system behavior
    • Sequence vs node-set handling
    xpath10CompatibilityMode?: boolean

    Enable XPath 1.0 backward compatibility mode (Phase 8.1). When true, XPath 2.0+ expressions follow XPath 1.0 type conversion rules. This enables:

    • XPath 1.0 boolean conversion semantics
    • XPath 1.0 numeric conversion (with NaN for empty sequences)
    • XPath 1.0 comparison rules (node-set to string conversion)
    • XPath 1.0 logical operator behavior (short-circuit, error suppression) Default: false (XPath 2.0 semantics)
    defaultCollation?: string

    Default collation for string comparisons (XPath 2.0+). Default: Unicode codepoint collation

    baseUri?: string

    Base URI for resolving relative URIs (XPath 2.0+).

    implicitTimezone?: string

    Implicit timezone as duration offset from UTC (XPath 2.0+). Example: '-PT5H' for US Eastern Time (UTC-5)

    extensions?: Record<string, any>

    Extension data for XSLT or custom implementations. This allows attaching arbitrary data to the context without polluting the main interface.

    currentDateTime?: Date

    Current dateTime in the dynamic context (XPath 2.0+). Returned by fn:current-dateTime(). If not provided, defaults to system time when accessed.

    availableDocuments?: XPathDocuments

    Available documents mapping for fn:doc() function (XPath 2.0+). Maps document URIs to their root document nodes. Example: { "http://example.com/data.xml": rootNode }

    availableCollections?: XPathCollections

    Available collections mapping for fn:collection() function (XPath 2.0+). Maps collection URIs to sequences of nodes. Example: { "http://example.com/collection": [node1, node2, ...] }

    defaultCollection?: string

    Default collection URI when fn:collection() is called without arguments (XPath 2.0+). If provided, fn:collection() returns availableCollections[defaultCollection].

    functionRegistry?: XPathFunctionRegistry

    Function implementations registry (XPath 2.0+). Maps QName function names to their implementations. Allows defining custom/XSLT functions at evaluation time. Format: "localName" or "prefix:localName"

    streaming?: StreamingConfig

    Streaming configuration

    streamingBuffer?: StreamingBuffer

    Streaming buffer

    streamingStats?: StreamingStats

    Streaming statistics

    streamingDepth?: number

    Current streaming depth (how many ancestors buffered)

    isStreaming?: boolean

    Whether currently in streaming mode