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 ...
Get XSLT and XPATH: A Guide to XML Transformations now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.