RE: conditional inclusions

Subject: RE: conditional inclusions
From: Dylan Walsh <Dylan.Walsh@xxxxxxxxxx>
Date: Wed, 1 Nov 2000 09:55:30 -0400 (EST)
Apologies if I'm wrong, but there may be some confusion on your part. If you
wish to use *data* in other files as the source of your transformation, you
use the document() function. There is more on this function in the FAQ or
Michael Kays book (an essential purchase, by the way). On the other hand,
import or include are used in XSL *to bring in other XSL*. Your use of the
".xml" suffix in your examples suggests you want to bring in data.

If in fact you are trying to bring in XSL code, the following may be
helpful: Both xsl:include or xsl:import must be top level elements in the
XSL file (as an aside, they differ only in the way they handle import
precedence). Therefore they cannot be part of a conditional construct as
they must be children of the xsl:stylesheet element (or its synonym
xsl:transformation), and you cannot put them in an xsl:choose or xsl:if.

The approach I have used in a recent project is to *unconditionally* import
all the other stylesheets, and use them *conditionally*. So the correct
template(s), once imported, are invoked inside conditional statements using
xsl:apply-templates or xsl:call-template.


> -----Original Message-----
> From:	Ronald [SMTP:ronald@xxxxxxxxxxx]
> Sent:	Tuesday, October 31, 2000 1:19 PM
> To:	xsl-list@xxxxxxxxxxxxxxxx
> Subject:	conditional inclusions
> 
> Hi there,
> can one of you guys explain to us something we call "conditional
> inclusions".
> say what?
> let me try to explain our problem.
> Let's say I have an XMl file which has an element such as:
> <include url="file.xml"/>
> This file would be part of the "input tree".
> You would probably say that xsl:include would do the trick, yes but that's
> not my question.
> We want to make these inclusions conditional, and than work on that result
> tree




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


Current Thread