Re: [xsl] Problems with formatting

Subject: Re: [xsl] Problems with formatting
From: Jörg Heinicke <joerg.heinicke@xxxxxx>
Date: Fri, 16 Nov 2001 22:09:24 +0100
1. <xsl:output method="text"/>

2. Avoid something like:

<xsl:template match="test">
test
</xsl:template>

because you have two linebreaks in this created textnode. Use
<xsl:text>test</xsl:text>.

3. The same in your xml:

If you have

<node>
    test
</node>

use something like <xsl:value-of select="normalize-space(text())"/>.

4. Avoid using built-in templates by <xsl:apply-templates/> (empty
text-nodes will be selected). Specify it more with <xsl:apply-templates
select="*|normalize-space(text())"/> (elements or non-emtpy text-nodes).

Hope this helps,

Joerg


> Hi,
>
> Thanks to those people who replied over my little date-reformatting
problem,
> that's sorted now.
>
> The problem I now face is this: I'm using xalan/xerxes to output a csv
file,
> problem is that because each field's processing is on a new line in the
xsl
> file, the resulting csv carries that formatting and so I've got a csv file
> where the items are strung out down the page. Which will never do.
>
> "Something",
>
>     "like",
>
>     "this",
>
>     "as",
>
>     "I",
>
>     "am",
>
>     "sure",
>
>     "you",
>
>     "understand"
>
>
> I've tried playing with <xsl:strip-space elements="*"/> but I'm sure that
> only affects the source xml document!! And I wasn't able to find anything
> relevant on the web... the problem definitely originates in my xsl file,
but
> short of physically putting the entire template on one line, I can't see a
> solution!!
>
> Any help with this problem will be greatly appreciated!
>
> Thanks,
> Curtis.


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


Current Thread