Name

$local-conventions — Transformation for local conventions.

Parameter:
{}local-conventions
Defined in:
param.xsl
Used in:
parameter-maps.xsl, drivers.xsl
Used by:
t:preprocess

Synopsis

$local-conventions as xs:string? := ()

Description

This parameter allows you to specify a tranformation for local markup conventions. This book uses several non-DocBook tagging conventions as a typing convenience, <att> for <tag class="attribute">, for example. These can be translated back into proper DocBook markup by the $local-conventions stylesheet. This stylesheet is run at the end of the t:preprocess step, just before validation (see $relax-ng-grammar).

The example stylesheet from the test suite looks like this:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://docbook.org/ns/docbook"
                xmlns:db="http://docbook.org/ns/docbook"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                exclude-result-prefixes="db xs"
                version="3.0">
 
<xsl:template match="db:att">
  <tag class="attribute">
    <xsl:copy-of select="@* except @class"/>
    <xsl:apply-templates/>
  </tag>
</xsl:template>
 
<xsl:template match="db:mode">
  <code role="{string-join(
                distinct-values((@role/string(), 'mode')),
                ' ')}">
    <xsl:copy-of select="@* except @role"/>
    <xsl:apply-templates/>
  </code>
</xsl:template>
 
<xsl:template match="element()">
  <xsl:copy>
    <xsl:apply-templates select="@*,node()"/>
  </xsl:copy>
</xsl:template>
 
<xsl:template match="attribute()|text()|comment()
                     |processing-instruction()">
  <xsl:copy/>
</xsl:template>
 
</xsl:stylesheet>

It transforms pseudo-DocBook elements “att” and “mode” into valid DocBook markup.