[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Conditional indentation?

Subject: Re: Conditional indentation?
From: "Christopher R. Maden" <crism@xxxxxxxxx>
Date: Sun, 07 Apr 2002 16:14:01 -0700
xsl output indentation
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At 15:02 7/4/02, Ned Batchelder wrote:
>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?

Variables may be set by other top-level elements, and that would require 
that the XSLT engine evaluate all of those variables (potentially deeply 
investigating the source XML) before setting up its output environment.

>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?

Make three stylesheets.  Two are very short:

indent.xsl:
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   version="1.0">
<xsl:import href="main.xsl"/>
<xsl:output method="html" indent="yes"/>
</xsl:transform>

noindent.xsl:
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   version="1.0">
<xsl:import href="main.xsl"/>
<xsl:output method="html" indent="no"/>
</xsl:transform>

And main.xsl has your actual templates.

HTH,
Chris
- -- 
Christopher R. Maden, Principal Consultant, crism consulting
DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training
<URL: http://crism.maden.org/consulting/ >
PGP Fingerprint: BBA6 4085 DED0 E176 D6D4  5DFC AC52 F825 AFEC 58DA
-----BEGIN PGP SIGNATURE-----
Version: PGP Personal Privacy 6.5.8

iQA/AwUBPLDSuKxS+CWv7FjaEQJVhwCcCcHdZURScBKI98jVbm/7tR6WCI8An2gP
SBfKQTW71PdtWFHq1IZUHHT0
=S7d2
-----END PGP SIGNATURE-----


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.