You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Hans-Guenter Stein <Ha...@siteos.de> on 2000/08/03 18:54:02 UTC

dynamic include

could anyone help me with this:

In my xsl-files I want to include a stylesheet only if the xml contains
a corresponding element:

main.xsl:
...
if (my xml contains an <article>-tag) <xsl:include
href="articleTemplate.inc"/>
...

HowTo???


Re: dynamic include

Posted by Hans-Guenter Stein <Ha...@siteos.de>.
the problem is that xsl:include needs to be an immediate child of
xsl:stylesheet whereas xsl:if may only be used in templates!

sudhi wrote:

> Hi,
> I dont know whether this works really or not (i mean syntax errors)....
> ......
> <xsl:if test="//article">
>   <xsl:include href="articleTemplate.inc"/>
> </xsl:if>
> ....
> HTH
> Sudhi
>
> Hans-Guenter Stein wrote:
> >
> > could anyone help me with this:
> >
> > In my xsl-files I want to include a stylesheet only if the xml contains
> > a corresponding element:
> >
> > main.xsl:
> > ...
> > if (my xml contains an <article>-tag) <xsl:include
> > href="articleTemplate.inc"/>
> > ...
> >
> > HowTo???
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: dynamic include

Posted by sudhi <su...@insage.com>.
Hi,
I dont know whether this works really or not (i mean syntax errors)....
......
<xsl:if test="//article">
  <xsl:include href="articleTemplate.inc"/>
</xsl:if>
....
HTH
Sudhi

Hans-Guenter Stein wrote:
> 
> could anyone help me with this:
> 
> In my xsl-files I want to include a stylesheet only if the xml contains
> a corresponding element:
> 
> main.xsl:
> ...
> if (my xml contains an <article>-tag) <xsl:include
> href="articleTemplate.inc"/>
> ...
> 
> HowTo???
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

Re: dynamic include

Posted by Donald Ball <ba...@webslingerZ.com>.
On Thu, 3 Aug 2000, Hans-Guenter Stein wrote:

> could anyone help me with this:
> 
> In my xsl-files I want to include a stylesheet only if the xml contains
> a corresponding element:
> 
> main.xsl:
> ...
> if (my xml contains an <article>-tag) <xsl:include
> href="articleTemplate.inc"/>
> ...
> 
> HowTo???

that's a general xsl question and should be directed to the xsl list at
mulberrytech, but the short answer here is there is no way to do that.

- donald