This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Conditional indentation?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]