xsl-list
[Top] [All Lists]

Re: Avoid outputting newlines in output method="text"

2002-09-16 11:22:34

On Wed, Sep 11, 2002 at 09:29:10PM +0200, J.Pietschmann wrote:
Add <xsl:strip-space elements="*"/> to the beginning of
your style sheet and check how much of your problem is
solved after this (look up details in a book, tutorial or
the spec http://www.w3.org/TR/xslt#strip).

Turned out that this in conjunction with 'normalize-space' was all I
needed.

---------------------------
    <xsl:template match="p">
      <xsl:element name="p">
        <xsl:apply-templates />
        </xsl:element>
        <xsl:text>&#10;</xsl:text>
        <xsl:text>&#10;</xsl:text>
    </xsl:template>

    <xsl:template match="p/text()">
      <xsl:value-of select="normalize-space(.)"/>
    </xsl:template>
---------------------------
-- 
Alex Polite
http://plusseven.com/gpg/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list