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

Subject: Re: [xsl] Formatting issue with HTML and TEXT output method
From: Abel Braaksma <>
Date: Thu, 17 Jul 2008 09:50:50 +0200
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?

-- Abel --

Current Thread