XSLT: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
 
(13 intermediate revisions by 4 users not shown)
Line 2: Line 2:


== Definition ==
== Definition ==
{{quotation|XSLT is designed to transform XML documents into other XML documents. The original document is not changed; rather, a new document is created based on the content of an existing one}} ([http://en.wikipedia.org/wiki/Xslt Wikipedia], retrieved 21:32, 30 May 2007 (MEST)).


{{quotation|A transformation expressed in XSLT is called a stylesheet. A stylesheet contains a set of template rules. A template rule has two parts: a pattern which is matched against nodes in the source tree and a template which can be instantiated to form part of the result tree. This allows a stylesheet to be applicable to a wide class of documents that have similar source tree structures.}}
{{quotation|A transformation expressed in XSLT is called a stylesheet. A stylesheet contains a set of template rules. A template rule has two parts: a pattern which is matched against nodes in the source tree and a template which can be instantiated to form part of the result tree. This allows a stylesheet to be applicable to a wide class of documents that have similar source tree structures.}}
([http://www.w3.org/TR/xslt XSL Transformations (XSLT)], retrieved 19:45, 30 May 2007 (MEST))
([http://www.w3.org/TR/xslt XSL Transformations (XSLT)], retrieved 21:32, 30 May 2007 (MEST))
 
{{quotation | A transformation expressed in XSLT describes rules for transforming a source tree into a result tree. The transformation is achieved by associating patterns with templates. A pattern is matched against elements in the source tree. A template is instantiated to create part of the result tree. The result tree is separate from the source tree. The structure of the result tree can be completely different from the structure of the source tree. In constructing the result tree, elements from the source tree can be filtered and reordered, and arbitrary structure can be added.}}([http://www.w3.org/TR/xslt XSL Transformations (XSLT)], retrieved 21:32, 30 May 2007 (MEST))
 
This page just provides a few links ....
 
== EduTechWiki Tutorials ==


{{quotation | A transformation expressed in XSLT describes rules for transforming a source tree into a result tree. The transformation is achieved by associating patterns with templates. A pattern is matched against elements in the source tree. A template is instantiated to create part of the result tree. The result tree is separate from the source tree. The structure of the result tree can be completely different from the structure of the source tree. In constructing the result tree, elements from the source tree can be filtered and reordered, and arbitrary structure can be added.}}([http://www.w3.org/TR/xslt XSL Transformations (XSLT)], retrieved 19:45, 30 May 2007 (MEST))
* [[XSLT Tutorial - Basics]]
* [[XPath tutorial - basics‎‎]]
* [[XSLT to generate SVG tutorial‎‎]]


== Tutorial ==
== In education ==


See [[XSLT Tutorial - Basics]]
Since some authoring environments favor some sort of XML-based datastructure, XSLT stylesheets can be used to "export" that data to some some delivery format (HTML, PDF, [[IMS Content Packaging]], etc.
An example would be the [[eLML]] framework.


== Links ==
== Links ==
Line 31: Line 42:
* See also: [http://www.w3.org/TR/xml-stylesheet Associating stylesheets with XML documents] (W3C proposed recommendation)
* See also: [http://www.w3.org/TR/xml-stylesheet Associating stylesheets with XML documents] (W3C proposed recommendation)
* See also: [http://www.w3.org/TR/xpath XML Path Language (XPath)] W3C Recommendation (9/99, used to identify nodes in a XML tree, e.g. within XSLT or Xptr)
* See also: [http://www.w3.org/TR/xpath XML Path Language (XPath)] W3C Recommendation (9/99, used to identify nodes in a XML tree, e.g. within XSLT or Xptr)
* [http://xmlfr.org/w3c/TR/xpath Langage XML Path (XPath)] (traduction fran�aise)
* [http://xmlfr.org/w3c/TR/xpath Langage XML Path (XPath)] (traduction française)
* [http://www.w3.org/TR/xpath20/ Xpath 2.0] is used both by XSLT 2.0 and XQuery. [xquery-pointers.html XQuery] is an extension of XPath 2.0 and both XSLT 2.0 and XQuery 2.0 share the same data model. (these are working drafts in nov 2004).
* [http://www.w3.org/TR/xpath20/ Xpath 2.0] is used both by XSLT 2.0 and XQuery.  
* [http://www.w3.org/TR/xquery-operators/ XQuery 1.0 and XPath 2.0 Functions and Operators]This is the specification for functions used both by XQuery 1 and XPath 2.0 (XSLT 2). This still missed a lot, e.g. trigonometric functions that are a must for any kind of visualization. See [http://www.exslt.org/ EXSLT extensions].
* [[XQuery]] is an XML Query language (built on top of XPath 2.0. Both XSLT 2.0 and XQuery 2.0 share the same data model).
* [http://www.w3.org/TR/xquery-operators/ XQuery 1.0 and XPath 2.0 Functions and Operators]. This is the specification for functions used both by XQuery 1 and XPath 2.0 (XSLT 2). This still misses a lot, e.g. trigonometric functions that are a must for any kind of visualization. See [http://www.exslt.org/ EXSLT extensions].


=== FAQ's ===
=== FAQ's ===
Line 44: Line 56:
* [http://www.mulberrytech.com/xsl/xsl-list/ XSL List at MulBerry Tech] ([http://www.mulberrytech.com/xsl/xsl-list/archive/ archive])
* [http://www.mulberrytech.com/xsl/xsl-list/ XSL List at MulBerry Tech] ([http://www.mulberrytech.com/xsl/xsl-list/archive/ archive])


== General Tutorials  ==
== Tutorials  ==
 
=== Introductory Tutorials ===


* [http://www.nwalsh.com/docs/tutorials/xsl/xsl/slides.html XSL Concepts and Practical Use ] by Paul Grosso and Norman Walsh
* [http://www.nwalsh.com/docs/tutorials/xsl/xsl/slides.html XSL Concepts and Practical Use ] by Paul Grosso and Norman Walsh
* [http://metalab.unc.edu/xml/books/bible/ Chapters from the XML bible] by E.R. Harold: XSLT, Xlinks and Xpointers. Direct acess: [http://www.ibiblio.org/xml/books/bible/updates/ Iblio]. See also his collection of [http://metalab.unc.edu/xml/slides/sd99east/ Slides] (full-day tutorial).
* [http://metalab.unc.edu/xml/books/bible/ Chapters from the XML bible] by E.R. Harold: XSLT, Xlinks and Xpointers. Direct acess: [http://www.ibiblio.org/xml/books/bible/updates/ Iblio]. See also his collection of [http://metalab.unc.edu/xml/slides/sd99east/ Slides] (full-day tutorial).


== 2.6 XSLT Tutorials  ==
* [http://www.webreference.com/js/column100/ XML and XSLT Programming], a Webreference.com tutorial


IMPORTANT: Some tutorials do not respect the current [http://www.w3.org/TR/WD-xslt XSLT Specification] [don't have time to clean them ou :( ]
* [http://www.objectsbydesign.com/projects/xslt/xslt_by_example.html XSLT by example] at Objects by Design (They also have good XML->HTML tutorials)


* [http://www.developer.com/xml/article.php/3314291 Discover the Wonders of XSLT] by Benoit Marchal a developper.com (2/2004). Very short intro, but follow ups were promised.
* [http://wdvl.internet.com/Authoring/Languages/XML/PracticalXML/ XSLT Chapter from the Paractical XML for the Web Book] (oct 2002, not tested)
* [http://www.webreference.com/js/column100/ XML and XSLT Programming], a Webreference.com tutorial
* [http://www.objectsbydesign.com/projects/xslt/xslt_by_example.html XSLT by example] at Objects by Design (They also have good XML->HTML tutorials)
* [http://metalab.unc.edu/xml/books/bible/updates/14.html E.R. Harolds on-line Book Chapter on XSLT] (good, the book too btw)
* [http://metalab.unc.edu/xml/books/bible/updates/14.html E.R. Harolds on-line Book Chapter on XSLT] (good, the book too btw)
* [http://www-4.ibm.com/software/developer/library/hands-on-xsl/ Hands-on XSL, XSL for fun and diversion ] ( Don R. Day ). Explains nicely how a rule-based system works.
 
* [http://www.ibm.com/developerworks/xml/library/x-hands-on-xsl/ Hands-on XSL, XSL for fun and diversion] ( Don R. Day ). Explains nicely how a rule-based system works. Note: IBM developWorks has dozens of other XSLT-related articles.
 
* [http://www.heise.de/ix/artikel/E/2001/01/167/01.shtml XSLT Tutorial I: Basics and first example application] at heise.de
* [http://www.heise.de/ix/artikel/E/2001/01/167/01.shtml XSLT Tutorial I: Basics and first example application] at heise.de
* [http://zvon.vscht.cz/HTMLonly/XSLTutorial/Books/Book1/index.html Introduction to XSL] On-line reference tool by Miloslav Nic (part of his [http://zvon.vscht.cz/ZvonHTML/Zvon/zvonTutorials_en.html zvon tutorials])
* [http://zvon.vscht.cz/HTMLonly/XSLTutorial/Books/Book1/index.html Introduction to XSL] On-line reference tool by Miloslav Nic (part of his [http://zvon.vscht.cz/ZvonHTML/Zvon/zvonTutorials_en.html zvon tutorials])
* [http://www.arbortext.com/xsl/ XSL Tutorial] by Paul Grosso and Norman Walsh. [new version ? an older version was incompatible ... ]
 
* [http://www.xmlsoftware.com/articles/xsl-by-example.html XSL Templates by Example ] by James Tauber. Works (but has only simple transformations)
* [http://www.xfront.com/ XSL Tutorial] (tutorial to download, by R.Costello)
* [http://www.xfront.com/ XSL Tutorial] (download, by R.Costello)
 
* [http://www.cogx.com/xwtl/presAll.asp XSLT template library for WEB applications]
* [http://nwalsh.com/docs/tutorials/xsl Walsh XSL Tutorial] Good tutorial, but slide style. Also useful as on-line XSL reference !
* [http://nwalsh.com/docs/tutorials/xml99/index.html Walsh XSL Tutorial] (updateded slides 18/1/00). Good tutorial, but slide style. Also useful as on-line XSL reference !
 
* [http://www.cogsci.ed.ac.uk/~dmck/xslt-tutorial.html Producing HTML tables with XSLT]
* [http://www.xml.com/pub/a/2005/01/05/tr-xml.html Extending XSLT with EXSLT] by Bob DuCharme, at xml.com (jan 2005)
 
* [http://www.xml.com/pub/a/2000/07/26/xslt/xsltstyle.html Style-free XSLT Style Sheets], by Eric van der Vlist, July 26, 2000
 
=== XSL Templates and tricks ===
 
* [http://www.jenitennison.com/xslt/index.html Jeni's XSLT Pages] Various very useful hints (mostly from postings to the XSL-List)
* [http://www.jenitennison.com/xslt/index.html Jeni's XSLT Pages] Various very useful hints (mostly from postings to the XSL-List)
* [http://www.byte.com/documents/s=7117/byt1017268553816/0401_udell.html The Protean Power of Textual Transformation]
* [http://en.wikipedia.org/wiki/XSLT_elements XSLT elements] List of XSLT elements at Wikipedia. This is a good page once you know your [[XSLT Tutorial - Basics|XSLT Basics]]
* [http://www.xml.com/pub/a/2005/01/05/tr-xml.html Extending XSLT with EXSLT] by Bob DuCharme, at xml.com (jan 2005)


== 2.7 XSLFO Tutorials ==
=== XSLFO Tutorials ===
(should be moved)
(should be moved)


Line 77: Line 95:
* [http://www.sun.com/software/xml/developers/fop/ FOP Slide Kit]. Technical article from Paul Sandoz (SUN) about slides with FOP
* [http://www.sun.com/software/xml/developers/fop/ FOP Slide Kit]. Technical article from Paul Sandoz (SUN) about slides with FOP


= 3. XSL for programmers =
=== 3.1 PHP's XSLT processor  ===


See the [/guides/xml/pointers.html XML Pointers] for now.
* [http://www.tonymarston.net/php-mysql/xsl.html Using PHP 5's XSL extension to perform XSL Transformations], tutorial by Tony Marston (8/2004)
 
== 3.1 PHP's XSLT processor  ==


* [http://www.tonymarston.net/php-mysql/xsl.html Using PHP 5's XSL extension to perform XSL Transformations], tutorial by Tony Marston (8/2004)
== Software ==


= 4. Software =
=== XSLT/FO Processors  ===


== 4.1 XSLT/FO Processors  ==
==== Online ====
* [http://www.online-xslt-processor.tk/ Automatic As You Type Online XSLT Processor]
* [http://www.freeformatter.com/xsl-transformer.html XSLT Transformer] (Freeformater.com)
* [http://www.online-toolz.com/tools/xslt-transformation.php XSLT transformation] (Onlinze-toolz)


==== Tools for programmers and web servers ====
* [http://saxon.sourceforge.net/ SAXON] The SAXON package is a collection of tools for processing XML documents, e.g. an XSL (XSLT and XPath).<br /> INSTALLED at Tecfa: [http://tecfa2.unige.ch/guides/xml/local/saxon/doc [password protected ] local documentation]. Saxon has extension features that others (Xalan) have not.
* [http://saxon.sourceforge.net/ SAXON] The SAXON package is a collection of tools for processing XML documents, e.g. an XSL (XSLT and XPath).<br /> INSTALLED at Tecfa: [http://tecfa2.unige.ch/guides/xml/local/saxon/doc [password protected ] local documentation]. Saxon has extension features that others (Xalan) have not.
* [http://www.xmlsoft.org/XSLT.html Gnome LibXML2 and it's associated XSLT C library]. Used in PHP 5.0. There also command line tools for batch use, including xsltproc that also does XInclude. Installed @ Tecfa
* [http://www.xmlsoft.org/XSLT.html Gnome LibXML2 and it's associated XSLT C library]. Used in PHP 5.0. There also command line tools for batch use, including xsltproc that also does XInclude. Installed @ Tecfa
Line 97: Line 117:
* [http://xmlroff.sourceforge.net/ xmlroff]. Sun sponsored xsl formatter for productin PDF and PS (2/2003). Early Beta, [not tested yet].
* [http://xmlroff.sourceforge.net/ xmlroff]. Sun sponsored xsl formatter for productin PDF and PS (2/2003). Early Beta, [not tested yet].


== 4.2 XSLT Libraries  ==
=== XSLT Libraries  ===


* [http://wwbota.free.fr/XSLT_models/README.html XSLT transforms library] (last update, 2004)
* [http://www.exslt.org/ EXSLT]. This is vital stuff for visualizations ! Some of these are implemented in XSLT processor, eg. libxslt (the popular processor also used in PHP)
* [http://www.exslt.org/ EXSLT]. This is vital stuff for visualizations ! Some of these are implemented in XSLT processor, eg. libxslt (the popular processor also used in PHP)
* [http://xsltsl.sourceforge.net/ XSLT Standard Library]. The [http://prdownloads.sourceforge.net/xsltsl/ downloads] are also in a different place (4/01)
* [http://xsltsl.sourceforge.net/ XSLT Standard Library]. The [http://prdownloads.sourceforge.net/xsltsl/ downloads] are also in a different place (4/01)
Line 104: Line 125:
* [http://incrementaldevelopment.com/xsltrick/ Gallery of Stupid XSL and XSLT Tricks]
* [http://incrementaldevelopment.com/xsltrick/ Gallery of Stupid XSL and XSLT Tricks]
* [http://wwbota.free.fr/XSLT_models/README.html XSLT transforms library] J.M. Vanel 2000-2003 - under GNU Public Licence
* [http://wwbota.free.fr/XSLT_models/README.html XSLT transforms library] J.M. Vanel 2000-2003 - under GNU Public Licence
* [http://fxsl.sourceforge.net/  FXSL -- the Functional Programming Library for XSLT] (powerful extensions in XSLT, e.g. a math module)
* [http://fxsl.sourceforge.net/  FXSL -- the Functional Programming Library for XSLT] (powerful library of functions, written entirely in XSLT, implements higher order functions (HOF), functional composition and currying (partial applications) in XSLT. All standard XPath 2.0 Functions and Operators are implemented as HOF. Other functions implemented are the equivalent of Haskell's Prelude, math functions, text processing, general LR Parsing Framework, ..., etc.)
 
== 4.3 Editors and Modes  ==
 
* [http://www.stylusstudio.com/xslt_editor.html Stylus XSLT Editor] is part of Stylus XML editor (Windows, payware = $275 academic, 30 Day demo, home edition = $49)
* [http://xslt-process.sourceforge.net/ XSLT-process] is a minor mode for GNU Emacs/XEmacs which transforms it into a powerful editor with XSLT processing and debugging capabilities (For people who know Emacs!)
 
== 4.4 Other tools  ==
 
* [http://grillade.griotte.com/xml/ XSLTDoc], an XSLT stylesheet documentation generator (tested/works)
* [http://www.xslprofiler.org catchXSL], an XSL profiler from I3 written in Java, needs Xalan or Saxon.
 
= 5. Examples =
 
Showing context-free examples is a tricky issue, since tree transformations and rendering depends on specific DTDs and tasks.
 
* [http://www.CraneSoftwrights.com/resources/ XSL Tree Display Stylesheet] from Crane Softwrigthts Ltd. Usefull to check the node structure of a document !
* Look at some simple [/guides/xml/cocoon Cocoon examples ] (you need Netscape or know to make IE Internet compatible to look at sources)
* [http://www.sourcepole.com/sources/software/sp.xsl/ Sourcepole XSL package]


= Other =
=== Editors and Plugins ===


* [http://www.xslt.com/ xslt.com]
* See [[XML editor]]s
* [http://finetuning.com/xsl.html Stylesheet Resources] (XSL/CSS/DSSL at finetuning.com


[[Category: XML]]
[[Category: XML]]
[[Category:web standards]]

Latest revision as of 17:09, 22 March 2013

Draft

Definition

“XSLT is designed to transform XML documents into other XML documents. The original document is not changed; rather, a new document is created based on the content of an existing one” (Wikipedia, retrieved 21:32, 30 May 2007 (MEST)).

“A transformation expressed in XSLT is called a stylesheet. A stylesheet contains a set of template rules. A template rule has two parts: a pattern which is matched against nodes in the source tree and a template which can be instantiated to form part of the result tree. This allows a stylesheet to be applicable to a wide class of documents that have similar source tree structures.” (XSL Transformations (XSLT), retrieved 21:32, 30 May 2007 (MEST))

“A transformation expressed in XSLT describes rules for transforming a source tree into a result tree. The transformation is achieved by associating patterns with templates. A pattern is matched against elements in the source tree. A template is instantiated to create part of the result tree. The result tree is separate from the source tree. The structure of the result tree can be completely different from the structure of the source tree. In constructing the result tree, elements from the source tree can be filtered and reordered, and arbitrary structure can be added.”(XSL Transformations (XSLT), retrieved 21:32, 30 May 2007 (MEST))

This page just provides a few links ....

EduTechWiki Tutorials

In education

Since some authoring environments favor some sort of XML-based datastructure, XSLT stylesheets can be used to "export" that data to some some delivery format (HTML, PDF, IMS Content Packaging, etc. An example would be the eLML framework.

Links

Manuals

Specifications, standards and official propaganda

Official Frameworks

FAQ's

NewsGroups and Mailing Lists

Tutorials

Introductory Tutorials

  • XSLT by example at Objects by Design (They also have good XML->HTML tutorials)
  • Walsh XSL Tutorial Good tutorial, but slide style. Also useful as on-line XSL reference !

XSL Templates and tricks

XSLFO Tutorials

(should be moved)

  • XSL-FO (very good on-line BOOK)
  • FOP Slide Kit. Technical article from Paul Sandoz (SUN) about slides with FOP

3.1 PHP's XSLT processor

Software

XSLT/FO Processors

Online

Tools for programmers and web servers

  • SAXON The SAXON package is a collection of tools for processing XML documents, e.g. an XSL (XSLT and XPath).
    INSTALLED at Tecfa: [password protected local documentation]. Saxon has extension features that others (Xalan) have not.
  • Gnome LibXML2 and it's associated XSLT C library. Used in PHP 5.0. There also command line tools for batch use, including xsltproc that also does XInclude. Installed @ Tecfa
  • tkxsltproc is a GUI frontend for the Gnome libxslt packages (see above). MacOSX, Win, Linux [9/2004]
  • Sablotron Sablotron is a fast, compact and portable XML toolkit implementing XSLT 1.0, DOM Level2 and XPath 1.0. Has some extensions, e.g. multiple output files. This is also the library used in PHP 4.x
  • Apache / Xalan-J is a Java-based XSLT 1.0 processor. Works with Xerces-Java (XML parser). Both are also distributed with other Apache products, like FOP. (installed @ Tecfa)
  • Apache / FOP is the world's first print formatter driven by XSL formatting objects. It is a Java application that reads a formatting object tree and then turns it into a PDF document. Installed @ Tecfa.
  • xmlroff. Sun sponsored xsl formatter for productin PDF and PS (2/2003). Early Beta, [not tested yet].

XSLT Libraries

Editors and Plugins