[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: RE: DOCBOOK-APPS: How to structure XSL stylesheets for chunkingandnon-chunking
> From: Jack Cushman <jcushman@avatartechnology.com>
>
> I'm new to XSL, but I'll give this a shot. How about setting chunking as a
> param. For example:
>
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
>
> <xsl:param name="chunk" select="'no'"/>
> <xsl:choose>
> <xsl:when test="$chunk = 'yes'">
> <xsl:import href="/usr/share/sgml/docbook-xsl-1.41/html/chunk.xsl"/>
> </xsl:when>
> <xsl:otherwise>
> <xsl:import href="/usr/share/sgml/docbook-xsl-1.41/html/docbook.xsl"/>
> </xsl:otherwise>
> </xsl:choose>
>
> ... your customizations ...
>
> </xsl:stylesheet>
>
>
>
> you could then call the file as:
>
> $ xsltproc -o sample.html /usr/share/sgml/e-smith.xsl sample.xml
>
> Or to generate multiple pages:
>
> $ xsltproc --param chunk yes /usr/share/sgml/e-smith.xsl sample.xml
>
> Hope this helps. (Heck, hope this even compiles, I haven't tried it...)
Nice try, and it looks like this should work,
but it won't . 8^)
The <xsl:choose> element is an instruction that must always
appear in a template body, so it cannot select which file
to import. And <xsl:import> is a top-level element that
must always be a child of <xsl:stylesheet>, so it cannot
be inside an <xsl:choose> anyway.
XSLT is a funny programming language that definitely
takes some getting used to.
bobs
Bob Stayton 400 Encinal Street
Publications Architect Santa Cruz, CA 95060
Technical Publications voice: (831) 427-7796
Caldera International, Inc. fax: (831) 429-1887
email: bobs@caldera.com
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC