Skip to Content
XSLT and XPATH: A Guide to XML Transformations
book

XSLT and XPATH: A Guide to XML Transformations

by John Robert Gardner, Zarella L. Rendon
July 2001
Intermediate to advanced
592 pages
11h 16m
English
Pearson
Content preview from XSLT and XPATH: A Guide to XML Transformations

A.1. Lists

Each of these list examples becomes successively more complex, beginning with a simple HTML output with LREs and building toward layered sub-lists using <xsl:number>. All examples except the last one work with the simple structure of the list shown in Example A-1.

A.1.1. Simple HTML Lists from XML with Literal Result Elements

The stylesheet in Example A-1 converts the input list to basic HTML output with ordered and unordered lists.

In this example, we directly match <list> elements, based on their type attribute (@) value of ordered or unordered, with a simple insertion of HTML ordered (<ol>) and unordered (<ul>) LREs. The <item> elements are then transformed into <li> elements. The use of <xsl:apply-templates> assures that the children ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning XSLT and XPath: Transforming XML Documents and Data

Beginning XSLT and XPath: Transforming XML Documents and Data

Ian Williams
Java and XSLT

Java and XSLT

Eric M. Burke
Learning XSLT

Learning XSLT

Michael Fitzgerald

Publisher Resources

ISBN: 0130404462Purchase book