Automating the Transformation
The idea is to automatically generate the XSLT style sheet in Listing 11.2 by using the document schema as a guide to the tags. For a simple example, consider the schema in Listing 11.4. This describes the format of the article document. Like the XSLT document, this schema is nothing more than an XML document itself.
Listing 11.4. The Article Document Schema
<?xml version =”1.0”?> <!-- http://www.w3.org/1999/XMLSchema and should work with MSXML 3--> <schema xmlns = “http://www.w3.org/1999/XMLSchema”> <element name = “article”> <complexType content = “elementOnly”> <sequence> <element ref = “headline”/> <element ref = “deck”/> <element ref = “byline”/> <element ref = “aBody”/> <element name = “copyright”/> </sequence> ... |
Get Special Edition Using XSLT 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.