




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to xslt (extensible stylesheet language transformations), a language used for transforming xml documents into other formats such as xml, html, or plain text. Xslt programs consist of templates and rules that describe how to transform input xml into output xml. The basics of xslt, including xslt processors, xslt elements, and examples of xslt templates. It also discusses how to use xslt to extract specific information from xml documents, such as finding titles of books authored by a specific author.
Typology: Slides
1 / 8
This page cannot be seen from the preview
Don't miss anything!





2
3
XSLT processor
XSLT program
Input XML Output XML Actually, output does not need to be in XML in general
5
6
Standard header of an XSLT document
… …
… …
… …
… …
body adds an attributed named attr with value body to the parent element in the output
11
12
Render a book title in italics in HTML Render the authors as a comma-separated list
1]”> ,
Display books in an HTML unordered list For each book, first display its title, and then display its sections in an HTML ordered list For each section, first display its title, and then display its subsections in an HTML ordered list
applies templates recursively to the node-set returned by xpath_expr
14
Bibliography
Even if a book or a section has no sections, we will still generate an empty element
15
:
20
21
Well-formed XML: syntactically correct Valid XML: well-formed and conforms to a DTD
An XPath expression selects a list of nodes in an XML document Used in other languages
FLWOR expression, quantified expression, aggregation, etc.
Transforms input XML by applying template rules recursively on the structure of input XML
Started out as a Java API, but now exists for other languages too Streaming input; callbacks for events (start/end of document and elements, chunk of characters, etc.)
Language-neutral API with implementations in Java, C ++, etc. Converts input into a main-memory tree; supports tree traversal, construction, and in-place modification
XML Schema to Java objects