XML transformation language: Difference between revisions

Content deleted Content added
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5
 
(111 intermediate revisions by 71 users not shown)
Line 1:
{{Short description|Type of programming language}}
An '''XML transformation language''' is a [[computer language]] designed specifically to transform an ''input'' XML document into an ''output'' XML document which satisfies some specific goal.
[[fr:Langage de{{Data transformation XML]]}}
{{Refimprove|date=July 2011}}
[[ImageFile:XML To XML Transformation.pngsvg|thumb|centerright|400px300px|An XML to XML transformation]]
<!-- TODO: ImageNode -->
An '''XML transformation language''' is a [[computerprogramming language]] designed specifically to transform an ''input'' [[XML]] document into an ''output'' XML 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==
AnAs '''XML to XML''' transformation outputs an XML document, it is current to chain '''XML to XML''' transformation tochains form [[XML pipeline]]s.
[[Image:XML To XML Transformation.png|thumb|center|400px|An XML to XML transformation]]
 
==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 {{code|LINKTYPE}} declaration, similarly to the [[document type declaration|{{code|DOCTYPE}} declaration]] used for a [[document type definition|DTD]].<ref>{{cite book |isbn=0-19-853737-9 |work=The SGML Handbook |title=Clause 12—Markup Declarations: Link Process Definition |last=Goldfarb |first=Charles F. |author-link=Charles Goldfarb |publisher=[[Clarendon Press]] |___location=[[Oxford]] |year=1990 |pages=433–449}}</ref> Other such transformation languages, addressing some of the deficiencies of LPDs, include [[Document Style Semantics and Specification Language]] (DSSSL) and [[OmniMark#Processing_structured input (XML, SGML)|OmniMark]].<ref>{{cite web |url=http://xml.coverpages.org/kimber-link95.html |title=Why I Want the SGML LINK Feature |first=W. Eliot |last=Kimber |website=CoverPages.org}}</ref> Newer transformation languages tend to target XML specifically, and thus only accept XML, not arbitrary SGML.
 
==Existing languages==
;* '''XSLT''': [[XSL Transformations|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 ishas expectedbecome toa beW3C releasedrecommendation soonsince asJanuary a W3C recommendation2007 and early implementations of the specification like [http://saxon.sourceforge.net/[Saxon SAXONXSLT|Saxon 8]] are already available.
;* '''XQuery''': [[XML query language|XQuery]] is a full functional language, despite having "query" in the name. It is a ''de facto'' :standard XQueryused by Microsoft, Oracle, DB2, MarkLogic, etc., is alsothe boundfoundation tofor the [[XRX (web application architecture)|XRX]] web programming model, and becomehas a W3C standardrecommendation for versions 1.0. XQuery is not anwritten in XML application,itself like XSLT. Consequentlyis, so its syntax is much lighter. The language is based on [[XPath 2.0]]. XQuery programs cannot have [[Side effect (computer science)|side-effecteffects]]s, 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. InXQuery additionis tologic thedriven, syntaxusing FOR, theWHERE mainand differencefunction betweencomposition XSLT(e.g. andfn:concat("<html>", XQuerygenerate-body(), is"</html>")). the In contrast, XSLT is data-driven (push processing model,) where certain conditions of the input document trigger the execution of templates, whichrather isthan notthe sharedcode withexecuting XQueryin 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.
; '''[[Streaming Transformations for XML|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 ([http://joost.sourceforge.net/ Joost]) and Perl ([http://stx.gingerall.cz/stx/xml-stx/index.html XML::STX]).
* '''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).
; '''[[XML Script]]''' : An imperative scripting language inspired by [[Perl]] that uses the XML syntax. XML Script supports [[XPath]] as well as its proprietary DSLPath for selecting nodes from the input tree.
;* '''STX''': [[Streaming Transformations for XML|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 ([https://web.archive.org/web/20030603110922/http://joost.sourceforge.net/ Joost]) and Perl ([https://archive.today/20030923074321/http://stxwww.gingerall.czcom/stxcharlie/ga/xml-stx/indexp_stx.htmlxml?s=org XML::STX]).
; '''[[FXT]]''' : A Functional XML Transformation Tool, implemented in [[ML_programming_language|Standard ML]].
;* '''XML Script''': [[XML Script]]''' :is Anan imperative scripting language inspired by [[Perl]] that uses the XML syntax. XML Script supports [[XPath]] as well asand its proprietary DSLPath for selecting nodes from the input tree.
; '''[[XDuce]]''' : A typed language with a lightweight syntax (compared to XSLT). The implementation is written in [[ML programming language|ML]].
;* '''[[FXT]]''' : AFXT Functionalis a functional XML Transformationtransformation Tooltool, implemented in [[ML_programming_languageML (programming language)|Standard ML]].
; '''[[CDuce]]''' : Extends [[XDuce]] to a general-purpose [[functional programming language]], see [http://www.cduce.org/ CDuce homepage].
;* '''XDuce''': [[XDuce]]''' :is Aa typed language with a lightweight syntax, (compared to XSLT). The implementationIt is written in [[ML programming language|ML]].
; '''[[Xtatic]]''' : Applies techniques from [[XDuce]] to [[C Sharp programming language|C#]], see [http://www.cis.upenn.edu/~bcpierce/xtatic/ Xtatic homepage].
;* '''[[CDuce]]''' : ExtendsCDuce extends [[XDuce]] to a general-purpose [[functional programming language]], see [http://www.cduce.org/ CDuce homepage].
; '''[[HaXml]]''' : A library and collection of tools to write XML transformations in Haskell. Its approach is very consistent and powerful. Also see [http://www.cs.york.ac.uk/fp/HaXml/ this paper about HaXml published in 1999] and [http://www-106.ibm.com/developerworks/xml/library/x-matters14.html this IBM developerWorks article].
* '''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 ([http://www.brics.dk/Xact/ XACT home page]).
; '''[[XMLambda]]''' : XMLambda (XM&lambda;) is described in a [[1999]] paper by [[Erik Meijer]] and [[Mark Shields]]. No implementation is available.
* '''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. ([http://hal.inria.fr/hal-00806343])
; '''[[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.
* '''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]].
[[Category:XML standards]] [[Category:Transformation languages|*]]
;* '''[[Xtatic]]''' : Applies[[Xtatic]] applies techniquesmethods from [[XDuce]] to [[C Sharp (programming language)|C#]], see [http://www.cis.upenn.edu/~bcpierce/xtatic/ Xtatic homepage].
* '''HaXml''': [[HaXml]] is a library and collection of tools to write XML transformations in [[Haskell (programming language)|Haskell]]. Also see [http://www.cs.york.ac.uk/fp/HaXml/ this paper about HaXml published in 1999] {{Webarchive|url=https://web.archive.org/web/20141018124509/http://www.cs.york.ac.uk/fp/HaXml/ |date=2014-10-18 }} and [http://www-106.ibm.com/developerworks/xml/library/x-matters14.html this IBM developerWorks article]. See also the more recent [https://web.archive.org/web/20060422010402/http://www.flightlab.com/~joe/hxml/ HXML] and Haskell XML Toolbox ([https://web.archive.org/web/20080622124011/http://www.fh-wedel.de/~si/HXmlToolbox/ 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 (computer scientist)|Erik Meijer]] and [[Mark Shields (computer scientist)|Mark Shields]]. No implementation is available. See [https://web.archive.org/web/20051123030818/http://www.cartesianclosed.com/pub/xmlambda/ XMLambda home page].
;* '''[[FleXML]]''' : FleXML is an XML processing language first implemented by Kristofer Rose. Its approach is to add actions to an XML [[Document Type Definition|DTD]] specifying processing instructions for any subset of the DTD's rules.
* '''Scala''': [[Scala (programming language)|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.<ref>{{Cite journal|title=XML Processing in Scala|first1=Dino|last1=Fancellu|first2=William|last2=Narmontas|date=June 2014|journal=XML London 2014|doi=10.14337/XMLLondon14.Narmontas01|pages=63–75|article-number=4 |doi-broken-date=12 July 2025 |isbn=978-0-9926471-1-7|doi-access=free}}</ref>
* '''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==
{{Reflist}}
 
{{DEFAULTSORT:Xml Transformation Language}}
[[fr:Langage de transformation XML]]
[[Category:XML standards]] [[Category:Transformation languages|*]]
[[Category:XML-based standards ]]