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

Match attributes

Because the DITA DTD defines a default class attribute value for each element, the parser automatically adds this attribute to each element when validating. As a result, when structured FrameMaker reads your document, each element will have a class attribute. These class attributes have no meaning to structured FrameMaker and can potentially confuse people working on the files, so the stylesheet ignores them.

The template matches all attributes and uses an <xsl:choose> statement to handle class attributes. The template copies any attributes that are not named class.

<xsl:template match="@*" mode="identity">
    <xsl:choose>
        <xsl:when test="name() = 'class'">
            <!-- Do nothing. -->
        </xsl:when>
        <xsl:otherwise>
            <xsl:copy/>
        </xsl:otherwise>
    </xsl:choose></xsl:template>

There are other attributes you might want to handle, such as domains and ditaarch:DITAArchVersion.

 

Next Page:
Match other nodes


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