This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Conditional indentation?
- From: Ned Batchelder <nedbatchelder at yahoo dot com>
- To: XSL-List at lists dot mulberrytech dot com
- Date: Sun, 7 Apr 2002 15:02:17 -0700 (PDT)
- Subject: [xsl] Conditional indentation?
- Reply-to: xsl-list at lists dot mulberrytech dot com
I'm using XSLT to produce HTML from XML for my
website. I transform locally, then FTP the result to
the server. When checking over the results of the
transform, I'd like to use
<xsl:output method='html' indent='yes'/>
but to save space in the final result, I'd like to
use:
<xsl:output method='html' indent='no' />
I tried setting a parameter to the stylesheet and then
using:
<xsl:output method='html' indent='{$indent}' />
but the indent attribute is not an attribute value
template. First question: why not? Why aren't all
attributes AVTs? It isn't hard to check for the
presence of a brace, so there's little overhead when
literal values are used (as they will be almost all
the time).
I tried creating two small stylesheets, with just
those <xsl:output> elements in them, and then
including them:
<xsl:include href='{$outputsheet}' />
But again, the href attribute is not an AVT.
Is there any way to accomplish what I want? Am I
overlooking something simple?
--Ned.
=====
Ned Batchelder, http://www.nedbatchelder.com
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list