ArticleslgStudy

science

XML transformation language

XML transformation language is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand XML transformation language rather than just read about it. In short: An XML transformation language is a programming language designed specifically to transform an input XML document into an output document which satisfies some specific goal. There are two special cases of transformation: XML to XML: the output document is an XML document.

XML transformation language — main illustration
XML transformation language — illustration

Key takeaways

  • XML transformation language belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect XML transformation language to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of XML transformation language from memory before moving on to harder problems.

Reference excerpt

An XML transformation language is a programming language designed specifically to transform an input XML document into an output document which satisfies some specific goal. There are two special cases of transformation:

XML to XML: the output document is an XML document. XML to Data: the output document is a byte stream.

XML to XML As XML to XML transformation outputs an XML document, XML to XML transformation chains form XML pipelines.

XML to Data The XML (EXtensible Markup Language) to Data transformation contains some important cases. The most notable one is XML to HTML (HyperText Markup Language), as an HTML document is not an XML document.

SGML origins The earliest transformation languages predate the advent of XML as an SGML profile, and thus accept input in arbitrary SGML rather than specifically XML. These include the SGML-to-SGML link process definition (LPD) format defined as part of the SGML standard itself; in SGML (but not XML), the LPD file can be referenced from the document itself by a LINKTYPE declaration, similarly to the DOCTYPE declaration used for a DTD. Other such transformation languages, addressing some of the deficiencies of LPDs, include Document Style Semantics and Specification Language (DSSSL) and OmniMark. Newer transformation languages tend to target XML specifically, and thus only accept XML, not arbitrary SGML.

Existing languages XSLT: XSLT is the best known XML transformation language. The XSLT 1.0 W3C recommendation was published in 1999 together with XPath 1.0, and it has been widely implemented since then. XSLT 2.0 has become a W3C recommendation since January 2007 and implementations of the specification like Saxon 8 are already available. XQuery: XQuery is a full functional language, despite having "query" in the name. It is a de facto standard used by Microsoft, Oracle, DB2, MarkLogic, etc., is the foundation for the XRX web programming model, and has a W3C recommendation for versions 1.0. XQuery is not written in XML itself like XSLT is, so its syntax is much lighter. The language is based on XPath 2.0. XQuery programs cannot have side-effects, just like XSLT and provides almost the same capabilities (for instance: declaring variables and functions, iterating over sequences, using W3C schema types), even though the program syntax are quite different. XQuery is logic driven, using FOR, WHERE and function composition (e.g. fn:concat("<html>", generate-body(), "</html>")). In contrast, XSLT is data-driven (push processing model) where certain conditions of the input document trigger the execution of templates rather than the code executing in the order in which it is written. XProc: XProc is an XML Pipeline language. The XProc 1.0 W3C Recommendation was published in May 2010. XML document transform: Is a Microsoft standard for performing simple transforms on XML documents. Primarily for creating IIS Web.config files (Config Transforms), other implementations allow it to be used for generic config files as build time (Slow Cheetah) or from the command line (CTT). STX: STX (Streaming Transformations for XML) is inspired by XSLT but has been designed to allow a one-pass transformation process that never prevents streaming. Implementations are available in Java (Joost) and Perl (XML::STX[link removed]). XML Script: XML Script is an imperative scripting language inspired by Perl that uses the XML syntax. XML Script supports XPath and its proprietary DSLPath for selecting nodes from the input tree. FXT: FXT is a functional XML transformation tool, implemented in Standard ML. XDuce: XDuce is a typed language with a lightweight syntax, compared to XSLT. It is written in ML. CDuce: CDuce extends XDuce to a general-purpose functional programming language, see CDuce homepage. XACT: XACT is a Java-based system for programming XML transformations. Notable features include XML templates as immutable values and a static analysis to ensure type safety using XML Schema types (XACT home page). XFun: XFun is a functional language X-Fun for defining transformations between XML data trees, while providing shredding instructions. X-Fun can be understood as an extension of Frisch's XStream language with output shredding, while pattern matching is replaced by tree navigation with XPath expressions. ([1]) XStream: XStream is a simple functional transformation language for XML documents based on CAML. XML transformations written in XStream are evaluated in streaming: when possible, parts of the output are computed and produced while the input document is still being parsed. Some transformations can thus be applied to huge XML documents which would not even fit in memory. The XStream compiler is distributed under the terms of the CeCILL free software license. Xtatic: Xtatic applies methods from XDuce to C#, see Xtatic homepage. HaXml: HaXml is a library and collection of tools to write XML transformations in Haskell. Also see this paper about HaXml published in 1999 Archived 2014-10-18 at the Wayback Machine and this IBM developerWorks article. See also the more recent HXML and Haskell XML Toolbox (HXT), which is based on the ideas of HaXml and HXML but takes a more general approach to XML processing. XMLambda: XMLambda (XMλ) is described in a 1999 paper by Erik Meijer and Mark Shields. No implementation is available. See XMLambda home page. FleXML: FleXML is an XML processing language first implemented by Kristofer Rose. Its approach is to add actions to an XML DTD specifying processing instructions for any subset of the DTD's rules. Scala: Scala is a general-purpose functional and object-oriented language with specific support for XML transformation in the form of XML pattern matching, literals, and expressions, along with standard XML libraries. LINQ to XML: LINQ to XML is a .NET 3.5 syntax and programming API available in C#, VB and some other .NET languages. LINQ is primarily designed as a query language, but it also supports XML transforms.

See also Filter (software) Filter (Unix) Web template Web template system Template engine (web) Tritium (programming language)

References

Illustrations

XML transformation language: An XML to XML transformation
An XML to XML transformation

Worked examples

Example 1 — a first encounter with XML transformation language

Start with the simplest possible case. Write down what XML transformation language claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to XML transformation language before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about XML transformation language ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of XML transformation language

In research
XML transformation language appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses XML transformation language in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
XML transformation language is common in secondary-school and first-year university syllabi. It links to neighbouring topics Transformation languages, XML-based standards, so understanding it makes those chapters shorter.
In everyday life
Look for XML transformation language outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “XML transformation language” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study XML transformation language in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what XML transformation language means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain XML transformation language out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is XML transformation language in simple terms?

An XML transformation language is a programming language designed specifically to transform an input XML document into an output document which satisfies some specific goal. There are two special cases of transformation: XML to XML: the output document is an XML document.

Why does XML transformation language matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study XML transformation language?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on XML transformation language.

Tags

  • Transformation languages
  • XML-based standards

Keep exploring