Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
XSLT
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Design and processing model== [[Image:XSLT en.svg|right|thumb|Diagram of the basic elements and process flow of eXtensible Stylesheet Language Transformations.]] The XSLT processor takes one or more XML source documents, plus one or more XSLT stylesheets, and processes them to produce one or multiple output documents.<ref>{{Citation |last1=Flatt |first1=Amelie |title=Phase III: Generating Artifacts from the Model |date=2022 |url=https://link.springer.com/10.1007/978-3-031-14132-4_5 |work=Model-Driven Development of Akoma Ntoso Application Profiles |pages=31β37 |place=Cham |publisher=Springer International Publishing |language=en |doi=10.1007/978-3-031-14132-4_5 |isbn=978-3-031-14131-7 |access-date=2023-01-07 |last2=Langner |first2=Arne |last3=Leps |first3=Olof|url-access=subscription }}</ref><ref>{{Cite web |title=XSL Transformations (XSLT) Version 2.0 (Second Edition) |url=https://www.w3.org/TR/xslt20/#creating-result-trees |access-date=2023-02-07 |website=www.w3.org |quote=Example: Multiple Result Documents}}</ref> In contrast to widely implemented [[imperative programming]] languages like [[C (programming language)|C]], XSLT is [[Declarative programming|declarative]].<ref>{{cite web |title=Discover the Wonders of XSLT: XSLT Quirks |url=http://www.developer.com/xml/article.php/3357231#Coding%20styles |quote=XSLT is a very specialized language with a distinct declarative flavor. |access-date=2011-02-11 |archive-date=2011-07-09 |archive-url=https://web.archive.org/web/20110709015528/http://www.developer.com/xml/article.php/3357231#Coding%20styles |url-status=dead }}</ref> The basic processing paradigm is pattern matching.<ref name=IBM>{{cite web|last=Kay|first=Michael|title=What kind of language is XSLT?|url=http://www.ibm.com/developerworks/library/x-xslt/|publisher=IBM|access-date=13 November 2013}}</ref> Rather than listing an imperative sequence of actions to perform in a stateful environment, template rules only define how to handle a node matching a particular XPath-like pattern, if the processor should happen to encounter one, and the contents of the templates effectively comprise [[functional programming|functional]] [[expression (programming)|expressions]] that directly represent their evaluated form: the result tree, which is the basis of the processor's output. A typical processor behaves as follows. First, assuming a stylesheet has already been read and prepared, the processor builds a source [[Tree data structure|tree]] from the input XML document. It then processes the source tree's root node, finds the best-matching template for that node in the stylesheet, and evaluates the template's contents. Instructions in each template generally direct the processor to either create nodes in the result tree, or to process more nodes in the source tree in the same way as the root node. Finally the result tree is serialized as XML or HTML text.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)