Download presentation
Presentation is loading. Please wait.
Published byEgbert Snow Modified over 9 years ago
1
DMT Seminar XSLT 2 Fleur Praal & Jeroen van Honk – 28 October 2014 Leiden University. The university to discover.
2
XSLT Leiden University. The university to discover. XSL = eXstensible Stylesheet Language, XML XSLT = XSL Transformations Transforms XML into X(HT)ML, PDF, MARC, etc. by working its way through the structure of the encoding Build result-tree from source-tree; with XSL-file that is a tree itself! XSLT processors open source: XALAN, SAXON, built-in in Oxygen
3
Getting started with XSLT Leiden University. The university to discover. 1.Study the XML source document structure 2.Outline the intended XML result document structure translation step: from content to element names 3.Create XSL-file specify it is a stylesheet create template to match the root of source document 4.Fill XSL-file 5.Configure transformation scenario 6.Check result 7.Repeat steps 4-6, if necessary
4
XSLT transformation XSLT stylesheet Leiden University. The university to discover.
5
XSLT elements (1) XSLT root element, opens stylesheet @match takes source-XML’s root as value, to specify path for transformation Leiden University. The university to discover.
6
@select to select values of elements from source document and inserts into result tree; note that the paths in the select-attribute must depart from the element mentioned in the match-attribute of the template to insert literal text into the result tree This sentence will be visible in the result. XSLT elements (2) Leiden University. The university to discover.
7
@select – to repeat an action for repeated elements in a source- XML context-setting: paths within a for-each loop must depart from the element that is mentioned in the select-attribute Leiden University. The university to discover. XSLT elements (3)
8
XSLT elements (4) @select @data-type @order to sort a list alphabeticaly or numerically, by the attribute specified note that must be the direct child of (or ) <xsl:sort select=“fullTitle” data-type=“text” order=“ascending”/> Leiden University. The university to discover.
9
X-Path / navigate down // hierarchy irrelevant. highest established element * any direct child (note: ≠ all direct children!)../ jump one level up @ navigate to attribute [criterion]
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.