Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Removes whitespace between element tags (done with <xsl:strip-space>)
- AND normalizes all text nodes
- (i.e. deletes leading and trailing spaces, and comprises \s+ to single spaces) -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="xml" omit-xml-declaration="yes"/>
- <xsl:strip-space elements="*"/>
- <xsl:template match="@*|node()">
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- </xsl:copy>
- </xsl:template>
- <xsl:template match="text()">
- <xsl:value-of select="normalize-space(.)"/>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement