This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
RE: How to structure XSL stylesheets for chunkingandnon-chunking
- To: docbook-apps at lists dot oasis-open dot org, dyork at e-smith dot com,jcushman at avatartechnology dot com
- Subject: RE: DOCBOOK-APPS: How to structure XSL stylesheets for chunkingandnon-chunking
- From: Bob Stayton <bobs at caldera dot com>
- Date: Mon, 30 Jul 2001 16:17:35 -0700 (PDT)
> 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
------------------------------------------------------------------
To unsubscribe from this elist send a message with the single word
"unsubscribe" in the body to: docbook-apps-request@lists.oasis-open.org