You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robert Koberg <ro...@koberg.com> on 2002/05/23 23:00:11 UTC
multiple XSLTs for the same XML
Hi,
I am having trouble converting a set of XSLTs I have which use
xsl:include. I want to use a standard cocoon way but i am not finding
it. I have looked through the docs and searched with google through
several mailing list threads. From what i can see i have to perform
multiple transformations in a row all the while using the new result. Is
there an easier way to combine the stylesheets so they seem like one?
Here is an example of what I am trying to discuss:
What is the best way to set up some thing like the following?
<xsl:include href="head.xsl"/>
<xsl:include href="banner.xsl"/>
<xsl:include href="nav.xsl"/>
<xsl:include href="footer.xsl"/>
<!-- the main source document is necessary for head, banner and the
apply-templates in the second column of the table (index.xml) -->
<!-- I can swap out this XSLT with one that has one or three columns or
a different structure, while still reusing the common XSLT -->
<xsl:template match="/">
<html>
<xsl:call-template name="head"/>
<body>
<xsl:call-template name="banner"/>
<table>
<tr>
<td>
<!-- the nav's content comes from a separate file (book.xml) -->
<xsl:call-template name="nav"/>
</td>
</tr>
<tr>
<td>
<xslapply-templates/>
</td>
</tr>
</table>
<xsl:call-template name="footer"/>
</body>
</html>
</xsl:template>
Thanks for any help,
-Rob
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: multiple XSLTs for the same XML
Posted by Artur Bialecki <ar...@digitalfairway.com>.
Well then, I think you can use a reference
to another pipeline:
<map:transform src="cocoon://whatever">
and have that pipeline aggregate your xslts
with <map:part>.
I haven't tried this before, so good luck.
Artur...
> -----Original Message-----
> From: Robert Koberg [mailto:rob@koberg.com]
> Sent: Thursday, May 23, 2002 5:13 PM
> To: cocoon-users@xml.apache.org
> Subject: Re: multiple XSLTs for the same XML
>
>
> Hi and thanks, but I want to do it without import or include.
>
> -Rob
>
> Artur Bialecki wrote:
>
> >I use the <xsl:import href="head.xsl"/>
> >before my first <xsl:template match="/">
> >and it works.
> >
> >Artur...
> >
> >
> >
> >>-----Original Message-----
> >>From: Robert Koberg [mailto:rob@koberg.com]
> >>Sent: Thursday, May 23, 2002 5:00 PM
> >>To: cocoon-users@xml.apache.org
> >>Subject: multiple XSLTs for the same XML
> >>
> >>
> >>Hi,
> >>
> >>I am having trouble converting a set of XSLTs I have which use
> >>xsl:include. I want to use a standard cocoon way but i am not finding
> >>it. I have looked through the docs and searched with google through
> >>several mailing list threads. From what i can see i have to perform
> >>multiple transformations in a row all the while using the new result. Is
> >>there an easier way to combine the stylesheets so they seem like one?
> >> Here is an example of what I am trying to discuss:
> >>
> >>What is the best way to set up some thing like the following?
> >><xsl:include href="head.xsl"/>
> >><xsl:include href="banner.xsl"/>
> >><xsl:include href="nav.xsl"/>
> >><xsl:include href="footer.xsl"/>
> >>
> >><!-- the main source document is necessary for head, banner and the
> >>apply-templates in the second column of the table (index.xml) -->
> >><!-- I can swap out this XSLT with one that has one or three columns or
> >>a different structure, while still reusing the common XSLT -->
> >><xsl:template match="/">
> >> <html>
> >> <xsl:call-template name="head"/>
> >> <body>
> >> <xsl:call-template name="banner"/>
> >> <table>
> >> <tr>
> >> <td>
> >><!-- the nav's content comes from a separate file (book.xml) -->
> >> <xsl:call-template name="nav"/>
> >> </td>
> >> </tr>
> >> <tr>
> >> <td>
> >> <xslapply-templates/>
> >> </td>
> >> </tr>
> >> </table>
> >> <xsl:call-template name="footer"/>
> >>
> >> </body>
> >> </html>
> >></xsl:template>
> >>
> >>Thanks for any help,
> >>-Rob
> >>
> >>
> >>---------------------------------------------------------------------
> >>Please check that your question has not already been answered in the
> >>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> >>
> >>To unsubscribe, e-mail: <co...@xml.apache.org>
> >>For additional commands, e-mail: <co...@xml.apache.org>
> >>
> >>
> >>
> >
> >---------------------------------------------------------------------
> >Please check that your question has not already been answered in the
> >FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> >
> >To unsubscribe, e-mail: <co...@xml.apache.org>
> >For additional commands, e-mail: <co...@xml.apache.org>
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: multiple XSLTs for the same XML
Posted by Robert Koberg <ro...@koberg.com>.
Hi and thanks, but I want to do it without import or include.
-Rob
Artur Bialecki wrote:
>I use the <xsl:import href="head.xsl"/>
>before my first <xsl:template match="/">
>and it works.
>
>Artur...
>
>
>
>>-----Original Message-----
>>From: Robert Koberg [mailto:rob@koberg.com]
>>Sent: Thursday, May 23, 2002 5:00 PM
>>To: cocoon-users@xml.apache.org
>>Subject: multiple XSLTs for the same XML
>>
>>
>>Hi,
>>
>>I am having trouble converting a set of XSLTs I have which use
>>xsl:include. I want to use a standard cocoon way but i am not finding
>>it. I have looked through the docs and searched with google through
>>several mailing list threads. From what i can see i have to perform
>>multiple transformations in a row all the while using the new result. Is
>>there an easier way to combine the stylesheets so they seem like one?
>> Here is an example of what I am trying to discuss:
>>
>>What is the best way to set up some thing like the following?
>><xsl:include href="head.xsl"/>
>><xsl:include href="banner.xsl"/>
>><xsl:include href="nav.xsl"/>
>><xsl:include href="footer.xsl"/>
>>
>><!-- the main source document is necessary for head, banner and the
>>apply-templates in the second column of the table (index.xml) -->
>><!-- I can swap out this XSLT with one that has one or three columns or
>>a different structure, while still reusing the common XSLT -->
>><xsl:template match="/">
>> <html>
>> <xsl:call-template name="head"/>
>> <body>
>> <xsl:call-template name="banner"/>
>> <table>
>> <tr>
>> <td>
>><!-- the nav's content comes from a separate file (book.xml) -->
>> <xsl:call-template name="nav"/>
>> </td>
>> </tr>
>> <tr>
>> <td>
>> <xslapply-templates/>
>> </td>
>> </tr>
>> </table>
>> <xsl:call-template name="footer"/>
>>
>> </body>
>> </html>
>></xsl:template>
>>
>>Thanks for any help,
>>-Rob
>>
>>
>>---------------------------------------------------------------------
>>Please check that your question has not already been answered in the
>>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>>To unsubscribe, e-mail: <co...@xml.apache.org>
>>For additional commands, e-mail: <co...@xml.apache.org>
>>
>>
>>
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org>
>
>
>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: multiple XSLTs for the same XML
Posted by Artur Bialecki <ar...@digitalfairway.com>.
I use the <xsl:import href="head.xsl"/>
before my first <xsl:template match="/">
and it works.
Artur...
> -----Original Message-----
> From: Robert Koberg [mailto:rob@koberg.com]
> Sent: Thursday, May 23, 2002 5:00 PM
> To: cocoon-users@xml.apache.org
> Subject: multiple XSLTs for the same XML
>
>
> Hi,
>
> I am having trouble converting a set of XSLTs I have which use
> xsl:include. I want to use a standard cocoon way but i am not finding
> it. I have looked through the docs and searched with google through
> several mailing list threads. From what i can see i have to perform
> multiple transformations in a row all the while using the new result. Is
> there an easier way to combine the stylesheets so they seem like one?
> Here is an example of what I am trying to discuss:
>
> What is the best way to set up some thing like the following?
> <xsl:include href="head.xsl"/>
> <xsl:include href="banner.xsl"/>
> <xsl:include href="nav.xsl"/>
> <xsl:include href="footer.xsl"/>
>
> <!-- the main source document is necessary for head, banner and the
> apply-templates in the second column of the table (index.xml) -->
> <!-- I can swap out this XSLT with one that has one or three columns or
> a different structure, while still reusing the common XSLT -->
> <xsl:template match="/">
> <html>
> <xsl:call-template name="head"/>
> <body>
>
> <xsl:call-template name="banner"/>
> <table>
> <tr>
> <td>
> <!-- the nav's content comes from a separate file (book.xml) -->
> <xsl:call-template name="nav"/>
> </td>
> </tr>
> <tr>
> <td>
> <xslapply-templates/>
> </td>
> </tr>
> </table>
> <xsl:call-template name="footer"/>
>
> </body>
> </html>
> </xsl:template>
>
> Thanks for any help,
> -Rob
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>