Table of contents

Abstract

Introduction

The basic concepts

Stylesheet organization

Root template

Match processing instruction nodes

Match text nodes

Match attributes

Match other nodes

Keepspace template

Using the stylesheet

The complete stylesheet

Stylesheet organization

The stylesheet does an XML-to-XML copy (called an identity transform) that provides special-case processing for text nodes and processing instructions. The templates used in the stylesheet perform these functions:

The stylesheet uses an <xsl:output> statement to ensure that the output is not indented.

<xsl:output method="xml" indent="no" xml:space="default" encoding="UTF-8"/>

For testing purposes, there are two versions of the <xsl:output> statement:

When you use indent="no", most of the output appears on one line. To debug the transform, you might want to see the output on multiple lines. In that case, uncomment the first <xsl:output> statement and comment out the second one. Just remember to restore the correct form of the <xsl:output> statement before putting your transform into production.

 

Next Page:
Root template


Scriptorium Publishing | Post Office Box 12761 Research Triangle Park, NC 27709 | (919) 481 2701 | info@scriptorium.com