Download presentation
Presentation is loading. Please wait.
Published byLinette Marsha Houston Modified over 9 years ago
1
Digital Media Technology Week 6
2
XML Source XSLT Stylesheet XML Result XSLT
3
Tree diagram of an XSLT stylesheet
4
<xsl:template match=“collection” >
5
Example: XML source Letter from De Erven F. Bohn to W. Blackwood and sons, January 22nd, 1873 Haarlem 22 January 1873 Dear Sirs! We beg to apply to you the kind request for sending us one week before the publication one copy of Bulwer's novel: Kenelm Chillingly, His adventures and opinions, which book you have in the press, for what we are inclined to pay 30 £. When it were possible to send us already now the first volume by the post; it would be yet more agreeable. Mr H.A. Kramers at Rotterdam readily will be our pledge. your truly De Erven F. Bohn
6
□ Include a template that points to the root element of the XML source. Getting started Letter from De Erven F. Bohn to W. Blackwood and sons, January 22nd, 1873 ….
7
… XML Source XSLT XML Result
8
□ Literal text can be added with the element. e.g. This sentence will be visible in the result. □ HTML tags may be added directly e.g. This text will be italicised Elements within
9
□ Use to select text from the XML source. e.g. □ Note that the paths in the select- attribute must depart from the element mentioned in the match-attribute of Elements within
10
XSLT transformation XSLT stylesheet
11
Exercise 1
12
Example: XML source Belgium Brussels Cyprus Nicosia Denmark Copenhagen …
13
XSLT stylesheet The capital of is.
14
□ needs to be used if all the elements on a certain level need to be shown. □ This XSLT element takes a select- attribute □ Note that the paths within must depart from the element that is mentioned mentioned in the select-attribute.
15
The capital of is. XSLT stylesheet
16
Exercise 2
17
□ Use to sort a list alphabeticaly or numerically □ This XSLT element also takes a select- attribute. It refers to the element the XSLT processor must sort by □ must be the direct child of (or )
18
Exercise 3
19
□ takes a “test” attribute □ The instructions within will only be carried out if the criterion in the test attribute can be evaluated as true □ Example:
20
Exercise 4
21
□ The items that will be selected within the loop can be filtered by adding a criterion within square brackets, directly after the element name. □ Operators that can be used to formulate such tests: =Equal to !=Not equal to <Less than >Greater than
22
Exercise 5
23
□ Elements within
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.