Sha256: 48ce5d10bac984b465bb1d8a2a4551e72bde1ef10df61bc5f9df1093461d86f1

Contents?: true

Size: 1.38 KB

Versions: 20

Compression:

Stored size: 1.38 KB

Contents

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="ISO-8859-1"/>
<xsl:param name="indent-increment" select="'   '"/>

<xsl:template name="newline">
  <xsl:text disable-output-escaping="yes">
</xsl:text>
</xsl:template>

<xsl:template match="comment() | processing-instruction()">
  <xsl:param name="indent" select="''"/>
  <xsl:call-template name="newline"/>
  <xsl:value-of select="$indent"/>
  <xsl:copy />
</xsl:template>

<xsl:template match="text()">
  <xsl:param name="indent" select="''"/>
  <xsl:call-template name="newline"/>
  <xsl:value-of select="$indent"/>
  <xsl:value-of select="normalize-space(.)"/>
</xsl:template>

<xsl:template match="text()[normalize-space(.)='']"/>

<xsl:template match="*">
  <xsl:param name="indent" select="''"/>
  <xsl:call-template name="newline"/>
  <xsl:value-of select="$indent"/>
    <xsl:choose>
     <xsl:when test="count(child::*) > 0">
      <xsl:copy>
       <xsl:copy-of select="@*"/>
       <xsl:apply-templates select="*|text()">
         <xsl:with-param name="indent" select="concat ($indent, $indent-increment)"/>
       </xsl:apply-templates>
       <xsl:call-template name="newline"/>
       <xsl:value-of select="$indent"/>
      </xsl:copy>
     </xsl:when>
     <xsl:otherwise>
      <xsl:copy-of select="."/>
     </xsl:otherwise>
   </xsl:choose>
</xsl:template>
</xsl:stylesheet>

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
test_server-0.5.2 spec/support/pretty_print.xsl
test_server-0.5.1 spec/support/pretty_print.xsl
test_server-0.5.0 spec/support/pretty_print.xsl
test_server-0.4.1 spec/support/pretty_print.xsl
test_server-0.4.0 spec/support/pretty_print.xsl
test_server-0.3.7 spec/support/pretty_print.xsl
test_server-0.3.6 spec/support/pretty_print.xsl
test_server-0.3.5 spec/support/pretty_print.xsl
test_server-0.3.4 spec/support/pretty_print.xsl
test_server-0.3.2 spec/support/pretty_print.xsl
test_server-0.3.1 spec/support/pretty_print.xsl
test_server-0.2.4 spec/support/pretty_print.xsl
test_server-0.2.3 spec/support/pretty_print.xsl
test_server-0.2.2 spec/support/pretty_print.xsl
test_server-0.2.1 spec/support/pretty_print.xsl
test_server-0.2.0 spec/support/pretty_print.xsl
test_server-0.1.2 spec/support/pretty_print.xsl
test_server-0.1.1 spec/support/pretty_print.xsl
test_server-0.1.0 spec/support/pretty_print.xsl
test_server-0.0.11 spec/support/pretty_print.xsl