E4X

1 program Added 2026-02-28T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: ECMAScript for XML, ECMA-357
Provenance: commit 90c5cb0b72 · authored 2026-02-28T15:40:53+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

3 sources · pl_id: pl/ecmascript-for-xml
LLM (this repo) · 1WikipediaWikidata · Q1274178

Related languages

ECMAScript for XML (1.00)JavaScript (0.25)ArkTS (0.19)ECMAScript (0.17)ErgoScript (0.17)

LLM-contributed programs

XML Catalog Query

Provenance: commit 90c5cb0b72 · authored 2026-02-28T15:40:53+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.js · license: Public Domain · added: 2026-02-28T10:00:00Z
// E4X - ECMAScript for XML (ECMA-357)
// Demonstrates XML literals and E4X operations

var catalog = <catalog>
  <book id="1">
    <title>JavaScript: The Good Parts</title>
    <author>Douglas Crockford</author>
    <price>29.99</price>
    <category>Programming</category>
  </book>
  <book id="2">
    <title>Learning XML</title>
    <author>Erik T. Ray</author>
    <price>39.99</price>
    <category>XML</category>
  </book>
  <book id="3">
    <title>Ajax: The Definitive Guide</title>
    <author>Anthony T. Holdener III</author>
    <price>49.99</price>
    <category>Programming</category>
  </book>
</catalog>;

// Access elements via dot notation
print("First book: " + catalog.book[0].title);

// Filter books by category using predicate
var programmingBooks = catalog.book.(@category == "Programming");
print("Programming books:");
for each (var book in programmingBooks) {
    print("  " + book.title + " by " + book.author);
}

// Compute total price
var total = 0;
for each (var b in catalog.book) {
    total += parseFloat(b.price);
}
print("Total price: $" + total.toFixed(2));

// Add a new book using XML literal
var newBook = <book id="4">
  <title>E4X in Action</title>
  <author>Sam Ruby</author>
  <price>34.99</price>
  <category>XML</category>
</book>;
catalog.appendChild(newBook);
print("Catalog now has " + catalog.book.length() + " books");

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about E4X (mapped to pl/ecmascript-for-xml). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/E4X/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← E++ E62qpodb593 →