Markdown

E4X

E4X is the Acronym for ECMAScript for Extensible Markup Language

ECMAScript for Extensible Markup Language is an extension that lets a script treat a markup document as a value. The script can read elements, filter them, and build new markup without first converting the document into a tree of generic objects. The extension was standardized and later overtaken by other ways of handling markup in scripts.

The markup it was built for is eXtensible Markup Language (XML). A script reads and writes that markup directly. A later library can do the same job without this particular extension.

What the Extension Added

  • A literal. Markup could appear in the script as markup, not as a quoted string.
  • Navigation. Child elements and attributes could be reached from the value.
  • A filter. A condition could select only the elements that matched.

This Extension and a Library

ComparedThe ExtensionA Markup Library
How markup appears in the scriptAs part of the languageAs data passed to functions
Standard statusAn older language extensionWhichever library the project chose
The documentStill markupStill markup