Skip to content

Generators - Deferred Evaluation in XPath 4

· Balisage Series on Markup Technologies · Vol 31 · 0 citations

TL;DR

This paper introduces generators as a first-class abstraction for deferred evaluation in XPath 4.0 and defines a composable library of functions that enables complex data-processing pipelines without eager evaluation.

Abstract

XPath lacks an explicitly-specified portable mechanism for processing large, unbounded, or externally sourced data without full materialization. The paper addresses this limitation by introducing generators as a first-class abstraction for deferred evaluation in XPath 4. Generators are represented as immutable records that encapsulate state and two operations—value access and progression—allowing result-values to be computed incrementally and only when demanded. On top of this abstraction, the paper defines a composable library of functions that enables complex data-processing pipelines without eager evaluation. This model provides: precise control over evaluation, natural support for infinite and streaming data, early termination without special constructs, and integration with external data sources via a precisely-defined provider protocol. The approach is entirely implementation-independent and is expressed using executable XPath definitions. Through examples and a real-world use case of news feed aggregation, the paper demonstrates how generators extend XPath with a practical and expressive model for resource-efficient computation.

View source

Similar papers

#artificial intelligence Preprint Sep 2026

Dynamic Adaptation of the LLM Context for Generating Routines with Coupled Semantics

LLM-based code generation fails when correctness depends on execution-dependent coupling: the meaning of one routine is defined by the runtime behavior of another, a relationship that cannot be resolved from textual descriptions alone. This limitation, which we call static binding, is not confined to explicitly coupled...

Gnaneswar Villuri, Hashmath Shaik, Alex Doboli · 1 citation
Open access Sep 2026

A framework for efficient and secure LLM agency: a case for the GraphQL paradigm

It is argued that GraphQL constitutes a principled, testable alternative to function calling for agentic systems, combining lower cost, stronger safety, and improved cognitive robustness.

Viktor Zhakhalov · 0 citations
Book Open access Oct 2026

Pattern-Guided Static Analysis for APIfication of COBOL Monoliths

Legacy COBOL mainframes resist APIfication due to monolithic structure and scattered logic. We present a novel pipeline that takes code blocks selected and validated by the user, potentially with AI-assisted boundary suggestions, and generates compilable API modules with request/response copybooks. Key innovations incl...

Vini Kanvar, Ashwin Dhinesh Kumar, Keerthi Narayan Raghunath · 1 citation
Open access Aug 2026

HMCFA: A Precise and Practical Big-Step Control Flow Analysis for Effect Handlers

HMCFA presents HMCFA, the first practical control flow analysis for effect handlers based on big-step semantics, and proves the concrete semantics equivalent to Bauer and Pretnar’s and establishes soundness of the abstraction via address freshness.

Tim A. Whiting, Kimball Germane · 0 citations
Preprint Sep 2026

Designing a Producer-driven Stream Protocol by Formal Refinement

The coroutine has broadly diffused in the practice of concurrent programming in the form of generators and asynchronous functions as well as processes communicating through pipes. We wanted to use coroutines in Python to create single-threaded Unix-style pipelines. Unfortunately, available solutions in Python are cumbe...

Erick Lavoie · 0 citations
Preprint Sep 2026

Pack Iteration in Swift: Ordinary Control Flow for Variadic Generics

Pack Iteration, a feature introduced in Swift 6.0 that allows developers to iterate over parameter packs using a familiar, imperative for-in loop, is presented, and empirical evaluation confirms that pack iteration provides performance comparable to - and sometimes significantly better than - the complex workarounds pr...

S. Nerush, Eitan Frachtenberg · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.