XSLT: how to ignore line feeds?

Posted by arnaud on Stack Overflow See other posts from Stack Overflow or by arnaud
Published on 2010-03-23T11:16:14Z Indexed on 2010/03/23 11:23 UTC
Read the original article Hit count: 488

Filed under:
|

Hi,

Given this example XML file:

<doc>
<tag>

    Hello !

</tag>
<tag>
    My
    name
    is
    John
</tag>
</doc>

And the following XSLT sheet:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> 
    <xsl:for-each select="doc/tag">
        <xsl:value-of select="."/>
    </xsl:for-each>
</xsl:template> 
</xsl:stylesheet>

How should I change it in order to ignore line feeds in the items? In other words, I would like to obtain:

Hello!
My name is John

Without all those those silly line feeds. ...the question is how.

Thanks in advance !

© Stack Overflow or respective owner

Related posts about xslt

Related posts about newline