Files
Facilitor/APPL/Shared/indent.xsl
Jos Groot Lipman 37265cdee0 API 2.0 in wording savepoint.
Beter XML ondersteunen, beter reserveringen aanmaken

svn path=/Website/trunk/; revision=21821
2014-06-05 10:11:19 +00:00

29 lines
903 B
XML

<?xml version="1.0" encoding="ISO-8859-15"?>
<!-- http://x443.wordpress.com/2011/page/34/ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="@*">
<xsl:copy/>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="normalize-space(.)" />
</xsl:template>
<xsl:template match="*">
<xsl:param name="indent" select="''"/>
<xsl:text>&#xa;</xsl:text>
<xsl:value-of select="$indent" />
<xsl:copy>
<xsl:apply-templates select="@*|*|text()">
<xsl:with-param name="indent" select="concat($indent, ' ')"/>
</xsl:apply-templates>
</xsl:copy>
<xsl:if test="count(../*)>0 and ../*[last()]=.">
<xsl:text>&#xa;</xsl:text>
<xsl:value-of select="substring($indent,3)" />
</xsl:if>
</xsl:template>
</xsl:stylesheet>