Xee XML Execution Engine

repository·main·Indexed 19 days ago

https://github.com/paligo/xee

Xee is a high-performance XML Execution Engine written in Rust, providing a CLI tool and libraries for Rust and PHP. It features an extensive implementation of XPath 3.1 and an evolving implementation of XSLT 3.0. The xee CLI serves as a "Swiss Army knife for XML," supporting XML loading, XPath execution, an interactive REPL, and pretty-printing. The project is modularized into several crates, including xee-xpath for high-level API access and xee-interpreter for the core bytecode virtual machine.

Tokens
46.6K
Snippets
142
Records
234
Agent score
67%

What's inside xee

  1. Overview of xee-interpreter

    main

    The xee-interpreter crate provides the runtime environment required to execute Xee code. It contains the core execution engine, including:

    • A bytecode interpreter.
    • An implementation of XPath data types.
    • The XPath standard library.

    Currently, it is used by xee-xpath to implement XPath functionality and is being developed to serve as an engine for executing XSLT code.

  2. What is xee-xpath-load?

    main
    The xee-xpath-load crate provides infrastructure for defining loaders for XML data. It is primarily used by xee-testrunner to facilitate XML data loading, but it can be used for other XML-related loading tasks. It is built on top of the xee-xpath crate.
  3. Use xee-xpath-lexer to tokenize XPath expressions

    main
    xee-xpath-lexer is a library designed to break XPath expressions into a stream of tokens. These tokens are intended to be consumed by a parser to build an Abstract Syntax Tree (AST) or perform other XPath-related analysis.
  4. Use the xee-xpath crate for programmatic XPath queries in Rust

    main
    The xee-xpath crate provides a high-level API for executing XPath 3.1 queries programmatically within Rust applications. It includes support for most of the XPath 3.1 standard library functions. For detailed usage patterns and code examples, refer to the official API documentation.
  5. Understand the purpose of xee-xslt-compiler

    main

    The xee-xslt-compiler is a low-level component of the Xee project. Its primary responsibility is to transform XSLT Abstract Syntax Trees (AST), as defined by the xee-xslt-ast crate, into an Intermediate Representation (IR). This IR is designed to be consumed and executed by the xee-interpreter crate.

    Note that this is a low-level utility. If you are looking for a high-level API entry point, use xee-xpath instead. If you want to use Xee via a command-line interface, download the xee binary from the official releases page.

  6. Understand XPath 3.1 implementation status in Xee

    main

    Xee implements several features of the XPath 3.1 specification, but it is not a complete implementation. When writing XPath expressions for use with Xee, be aware of the following limitations:

    Unsupported Features

    • Schema Support: There is currently no support for in-scope schema definitions, schema import processing, or type annotation in XDM. Everything is treated as xs:untypedAtomic.
    • Static Typing: Static typing features are not implemented.
    • XPath 1.0 Compatibility: There is no implementation plan for XPath 1.0 compatibility mode.
    • Advanced Contexts: Features like default calendars, default places, available documents/text resources/collections, and environment variables are not yet supported.
    • Optimization: No expression optimization is currently performed.
    • Error Function: The error() function is not yet complete.

    Supported Core Concepts

    • Atomization: Xee supports atomization for arithmetic, comparison, inline function calls, and cast expressions. Note that because schema support is missing, nodes are returned as xs:untypedAtomic.
    • Effective Boolean Value: Xee implements the standard rules for converting sequences to booleans (e.g., empty sequences are false, non-zero numbers are true).
    • Document Order: Nodes maintain document order.
    • Maps and Arrays: Support for map/array constructors and lookup operators (?) is available.
  7. Understand the role of xee-xpath-ast

    main

    The xee-xpath-ast crate provides the implementation of the parser and Abstract Syntax Tree (AST) for XPath expressions. It is a low-level component used by xee-xpath-compiler and builds upon xee-xpath-lexer.

    Note for end-users: This is a low-level crate. If you are looking for a high-level API entry point to work with XPath, you should use the xee-xpath crate instead. If you want to use the command line tool, download a release from the Xee GitHub releases page.

  8. Compile XPath text to Xee IR using xee-xpath-compiler

    main

    The xee-xpath-compiler crate is a low-level component used to compile XPath text into Xee Intermediate Representation (IR). It utilizes xee-xpath-ast for parsing and produces an IR that can subsequently be compiled to bytecode for execution by the xee-interpreter.

    Note for high-level usage: This is a low-level crate. If you are looking for the primary API entry point for XPath operations, use the xee-xpath crate instead. If you want to use the command-line tool, download a release from the Xee GitHub releases page.

  9. Understand the purpose of xee-name

    main
    The xee-name crate provides low-level XML name and namespace support used throughout the Xee project. It is a foundational component designed for handling XML identifiers and their associated namespaces.
  10. Understand the purpose of xee-schema-type

    main

    The xee-schema-type crate provides implementations for xs types as defined by the XPath and XML Schema specifications. It is designed to support Rust integration for these types.

    Note: This is a low-level crate. If you are looking for the primary API entry point for XPath operations, use xee-xpath. If you want to use the command-line tool, download a release.

  11. Use xee-xpath-macros for creating XPath library functions

    main

    The xee-xpath-macros crate provides procedural macros designed to simplify the creation of library functions for XPath. It is a low-level component of the Xee project, primarily used by xee-interpreter to implement its library submodule.

    Note: This is a low-level crate. If you are looking for the primary API entry point for XPath operations, use xee-xpath instead. If you want to use the command-line tool, download a release from the Xee GitHub repository.

  12. Use Xee for XML and XPath tasks

    main

    The xee command line tool is designed as a Swiss Army knife for XML. It supports the following capabilities:

    • Loading XML documents: Load and manipulate XML files.
    • XPath execution: Issue XPath expressions against XML documents.
    • REPL: Interactive XPath evaluation.
    • Pretty-printing: Format XML documents for readability.