home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2003 August / PCpro_2003_08.ISO / files / surfkit / browser / webhigh / WHSetup.exe / WEBH.XSL < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-28  |  968 b   |  30 lines

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  2.     <xsl:output method="xml" encoding="UTF-8" />
  3.     <xsl:variable name="indent" select="1" />
  4.     <xsl:variable name="spaces" select="'                  '"/>
  5.     <xsl:template match="*">
  6.         <xsl:variable name="varspaces" select="substring($spaces, 1, count(ancestor::node()) * $indent)"/>
  7.         <xsl:value-of select="$varspaces"/>
  8.         <xsl:copy>
  9.             <xsl:copy-of select="@*"/>
  10.             <xsl:choose>
  11.                 <xsl:when test="*">
  12.                     <xsl:apply-templates/>
  13.                     <xsl:value-of select="concat(' ', $varspaces)"/>
  14.                 </xsl:when>
  15.                 <xsl:otherwise>
  16.                     <xsl:value-of select="normalize-space()"/>
  17.                 </xsl:otherwise>
  18.             </xsl:choose>
  19.        </xsl:copy>
  20.     </xsl:template>
  21.     <xsl:template match="NOTE">
  22.         <xsl:copy>
  23.             <xsl:value-of select="."/>
  24.         </xsl:copy>
  25.     </xsl:template>
  26.     <xsl:template match="comment()|processing-instruction()">
  27.        <xsl:copy/>
  28.     </xsl:template>
  29. </xsl:stylesheet>
  30.