$local-conventions

$local-conventions — Transformation for local conventions.

Parameter:
{}local-conventions
Defined in:
param.xsl
Used in:
docbook.xsl, param.xsl
Used by:

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 during the $v:standard-transforms, just before validation (see $relax-ng-grammar).

For example, the test suite stylesheet that transforms pseudo-DocBook elements “att” and “mode” into valid DocBook markup 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>
   | 
   |