cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: newbie: delete whitespace
Date Wed, 17 Jul 2002 13:11:50 GMT
Really *any* whitespace?

<xsl:template match="@*|node()">
   <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
   </xsl:copy>
</xsl:template>

<xsl:template match="text()">
   <xsl:value-of select="translate(normalize-space(), ' ', '')"/>
</xsl:template>

There are only whitespaces left in attribute values (which you can remove 
too) and where they are necessary because of XML well-formedness. But I 
think, you don't mean *any*, so remove the translate().

Regards,

Joerg

Daniel Meier wrote:
> hi there
> 
> is there a simple solution to transform an xml-file to a new one without any
> whitespace?
> 
> kind regards
> 
> daniel

-- 

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@virbus.de
www.virbus.de


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message