Re: [xsl] Formatting issue with HTML and TEXT output method

Subject: Re: [xsl] Formatting issue with HTML and TEXT output method
From: "Senthilkumaravelan K" <skumaravelan@xxxxxxxxxxxxxx>
Date: Thu, 17 Jul 2008 08:28:01 -0700
Hi Abel,
We have an two xslt, one produces the HTML  output and other produces
the text output for the same xml data.
My xml data has more nodes than I have given in my last example.

Always <cond> node has html content as text node value .
When We render it in html output, base on the formatting elements
being used in html tag
it get displayed properly.

In case of text output,  I loose the formatting attributes of the html
content in the <cond> for the text output method.

Hope I am clear in my question.


On Thu, Jul 17, 2008 at 12:50 AM, Abel Braaksma <> wrote:
> Senthilkumaravelan K wrote:
>> When we write xslt one with "html" as output method and text as output
>> method.
>> for html out method am using
>> <xsl:value-of select="//cond">
>> text output method
>> <xsl:copy-of select="//cond">
>> How to make the text xslt output like formatted text output pretty
>> with alignment.
> Hi Senthil,
> Text output does what you say it does: it outputs text. No tags, no PI's, no
> comment nodes, just text. It also won't indent. This is per the spec and
> quite obvious when you come to think of it: with text you are in control
> yourself, 100%, so adding whitespace would be a violation of that principle.
> Using value-of on a full document (why are you using //?, you could just as
> well use the absolute path) with output method set to html will only include
> the whitespace that is inside the nodes and will not add any extra
> whitespace. This is basically the same as not using any templates at all:
> the default template of any XSLT does exactly that.
> Q: what are you after? Can you give an example of what you want so we could
> help you get there, with or without text output?
> HTH,
> Cheers,
> -- Abel --

Current Thread