Pattern matching / XPath 3.1 / XQuery 3.1 / CSS 3 Selector Online Tester

(You can find the documentation below)

HTML/XML/JSON-Input file:
Pattern matching XPath 3.1 XQuery 3.1 CSS 3.0 selectors Autodetect


disable auto refresh disable syntax highlighting
Output Options: Node format:: Output format:: Show types Hide variable names
Compatibility: Disable extended strings (e.g. x"{$varname}") Disable JSONiq (e.g. {"a": 1}("a")) Disable JSONiq literals (true,false,null) Only JSON types in objects (e.g. {"a": null} != {"a": ()})    Allow dot notation (e.g. {"a": 1}.a): : Strict type checking Strict namespaces case sensitive

Old languages: XPath 2.0 XPath 3.0 XQuery 1.0 XQuery 3.0

New languages: XPath 4.0 XQuery 4.0

Result of the above expression applied to the above input file:

, result-only



What is this about?

Here you can test pattern matching, CSS 3 selectors, standard XPath/XQuery 3.1, and JSONiq expressions.
XPath, XQuery, and CSS Selectors are W3C standardized query languages. The new XPath versions, from XPath 2.0 on, should not be confused with the old XPath 1.0. While old XPath can only process sets of XML nodes, XPath 2 can process any kind of data sequence. Modern XPath is a Turing-complete functional programming language.
JSONiq was a proposed extension to XQuery to query JSON, but with XPath 3.1 supporting JSON, it is rarely needed.
Pattern matching (also called templates) is my own extension: every node in the pattern is searched in the input. The {} text nodes in the pattern contain XPath expressions that are evaluated with the result being assigned to variables.
It is a nearly standalone implementation of the standards into the Pascal Internet Tools library written for the VideLibri app.

You can find more details in the corresponding Pascal unit documentation:
    Documentation of the XQuery / XPath / CSS 3 selector implementation.
    Documentation of the pattern syntax.

Other related links:
    Xidel, the command line version of this XQuery processor for web page downloading/scraping and any kind of XML/HTML/JSON processing.
    XQuery Test Suite Results.
    Internet Tools library, the Pascal library page.
    Source repository.
    Github mirror (Xidel excluding library).