Download presentation
Presentation is loading. Please wait.
Published byJeremy Pidcock Modified over 10 years ago
1
XML: Managing Data Exchange Stylesheets
2
Lesson Contents CSS The basic XSL file XSL transforms Templates Sort Numbering Parameters and Variables Datatypes Multiple Stylesheets Helpful Suggestions Questions Exercises
3
CSS Cascading Style Sheets “a language that describes the presentation form of a structured document” Allows the separation of style and content in web pages More accessibility and faster load times
4
CSS Standard XHTML #main { border: 1px solid #00F; } #content { border: 1px solid #F00; } …
5
CSS Link the CSS from a separate file Standard XHTML …
6
XSL File Tour Guide Cities City: Population: Country:
7
XSL File – Declaration and Stylesheet Start Tour Guide Cities City: Population: Country:
8
XSL File – Template and Output Tour Guide Cities City: Population: Country: Output element attributes Listed in the chapter
9
XSL File – Apply Template Tour Guide Cities City: Population: Country:
10
XSL File – For-each Tour Guide Cities City: Population: Country:
11
XSL Tranforms Can be used to transform an XML source into many different types HTML, XML, XHTML, Text
12
XSL Tranforms Show XSL to XML file
13
Templates
14
Template Result
15
Sorting Used to sort items from the xml file
16
Numbering allows you to insert numbers into your results
17
Parameters and Variables Required name attribute, but optional select Variable declared anywhere, but parameter only at beginning of template Can extend depending on where declared
18
Datatypes 5 different types: Node-set, String, Number, Boolean, Result tree fragment Ex: Belmopan is the capital of Belize To get the information out of the variable: <xsl:template match="city"
19
Multiple Stylesheets By using import and include, multiple stylesheets can be used Ex: Multiple XML documents can be processed as well using the document() function.
20
Multiple Stylesheets Will add a new element, amenityList, and fill it with content from the amenity.xml file Document() is a function. Examples of others can be found at http://www.w3schools.com/xsl/xsl_functions.asp
21
Helpful Suggestions Don’t make massive changes in order to fix problems. This could lead you away from the actual fix. Step through your code before running it. Folder options Search online with “XML tutorials” http://www.w3schools.com/xsl
22
Questions ? ?
23
Exercises Using the movie example produced for previous chapters, create a stylesheet that converts your xml to HTML. Incorporate the sort (last name) and numbering function with the actors. Also, add an “ad” at the bottom of the page for a country using the xml file given Now create a second stylesheet that converts the xml into xml.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.