Subject: [xsl] XSLT to remove characters and whitespaces From: "Georg Hohmann" <georg.hohmann@xxxxxxxxx> Date: Fri, 7 Jul 2006 12:33:31 +0200 |
i have a xml file with some content in it which contains some unwanted carriage returns and whitespaces. Now I'm trying to write a stylesheet which makes an exact copy of the source file but without the returns and whitespaces. I thought this should work:
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output name="stripped" method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="/"> <xsl:result-document format="stripped" href="result.xml"> <xsl:apply-templates/> </xsl:result-document> </xsl:template> <xsl:template match="*"> <xsl:element name="{name()}"> <xsl:value-of select="normalize-space(translate(translate(., '
', ' '), '	', ' '))"/> <xsl:apply-templates/> </xsl:element> </xsl:template> </xsl:stylesheet>
Regards, Georg
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Re: XSL issue, Mukul Gandhi | Thread | [xsl] Re: XSLT to remove characters, Georg Hohmann |
RE: [xsl] Simple XSL styling questi, Michael Kay | Date | [xsl] passing template names, Karl |
Month |