xsl-list
[Top] [All Lists]

Re: [xsl] Converting xml to csv

2006-12-11 08:02:07

text nodes in the stylesheet  are only stripped if tehy are -all_ white_
you have

<xsl:template match="power">
        [
        <xsl:value-of select="."/>
        ]
<xsl:template>

so your first text node is 
newline,tab,bracket,newline,tab
so that whole text node is copied to the result.

Basic rule is always put literal text in xsl:text so that stylesheet
indentation is then in white space text nodes and will be ignored

<xsl:template match="power">
        <xsl:text>[</xsl:text>
        <xsl:value-of select="."/>
        <xsl:text>]</xsl:text>
<xsl:template>

if you don't want to follow that rule, just make sure that the text
nodes don't have extra whitesoace:

<xsl:template match="power">[<xsl:value-of select="."/>]<xsl:template>

David


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>