<?xml version="1.0" encoding="utf8"?>
<!--

$Id: text-review.xsl,v 1.7 2004/10/13 23:00:15 jmates Exp $

The author disclaims all copyrights and releases this document into
the public domain.

Stylesheet to output eolas format into a textual format suitable for
feeding to spelling and grammar checkers.  Goals include removing all
the XML tags, skipping data blocks, and normalizing command and other
computer-related documentation into patterns more easily ignored in
custom dictionaries.

TODO: better spacing between adjacent elements (newlines), and maybe
figure out how to get rid of the leading spaces in the output?

-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0">
  <xsl:strip-space elements="*"/>
  <xsl:variable name="newline">
    <xsl:text>
</xsl:text>
  </xsl:variable>
  <xsl:output method="text"/>
<!-- elements we skip outright -->
  <xsl:template match="summary/version"/>
  <xsl:template match="summary/source"/>
  <xsl:template match="data"/>
  <xsl:template match="image|image-svg"/>
  <xsl:template match="info|note|warn|summary/*|li|title">
    <xsl:apply-templates/>
    <xsl:value-of select="$newline"/>
    <xsl:value-of select="$newline"/>
  </xsl:template>
<!-- normalize data markup for easy skippage -->
  <xsl:template match="input|code|cmd|cmd-arg|gui|file|file-glob|host|perl-module|perl-pod|man|rfc">
    <xsl:text>DATA</xsl:text>
  </xsl:template>
<!-- need to expand out some special elements -->
  <xsl:template match="acronym">
    <xsl:value-of select="name"/>
    <xsl:text> (</xsl:text>
    <xsl:value-of select="abbr"/>
    <xsl:text>)</xsl:text>
  </xsl:template>
</xsl:stylesheet>
