You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Torsten Schlabach <TS...@gmx.net> on 2003/05/13 13:22:48 UTC

Can I use request or sitemap parameters in my page?

Dear list,

here is what I am trying to do:

I want all HTML pages that are served through Cocoon to be wrapped into a
template which is a separate file. Therefore I wrote my template; let's assume
it look like this for simplicity:

<html>
<head>
<title>This is Torsten's Website</titile>
<body>

<!-- In real life there should be some left menu code here -->

<xi:include href="thisiswheretheproblemis"/>

</body>
</head>
</html>

It is obvious that in the place where it says "thisiswheretheproblemis" I
would need to put in the name of the actual html file from the original
request.

Can I do that? I can access sitemap parameters in XSL, but I think it's not
necessarily a lean approach. Or is there an entirely different way of doing
this?

Torsten


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Can I use request or sitemap parameters in my page?

Posted by Charles Yates <ce...@stanford.edu>.
Use your own template language:

http://www.xml.com/pub/a/2002/03/27/templatexslt.html

use a stylesheet to associate your document with a template like this:

<xsl:template match="/">
<xsl:apply-templates select="document('myTemplate.xml')/*" />
</xsl:template>

have most template elements copied:

<xsl:template match="*">
<xsl:element name="{name()}">
<xsl:apply-templates select="@* | *" />
</xsl:element>
</xsl:template>

have templates for your content:

<xsl:template match="torsten:content">
<xsl:apply-templates select="/torsten:content/*"/>
</xsl:template>

insert your document's text with special tags in the template
myTemplate.xml:

<html>
<body>
<torsten:content/>
</body>
</html>

your content would look like this:

<torsten:content>
<h1>Here is my stuff!</h1>
</torsten:content>

> Dear list,
>
> here is what I am trying to do:
>
> I want all HTML pages that are served through Cocoon to be wrapped into a
> template which is a separate file. Therefore I wrote my template; 
> let's assume
> it look like this for simplicity:
>
> <html>
> <head>
> <title>This is Torsten's Website</titile>
> <body>
>
> <!-- In real life there should be some left menu code here -->
>
> <xi:include href="thisiswheretheproblemis"/>
>
> </body>
> </head>
> </html>
>
> It is obvious that in the place where it says "thisiswheretheproblemis" I
> would need to put in the name of the actual html file from the original
> request.
>
> Can I do that? I can access sitemap parameters in XSL, but I think 
> it's not
> necessarily a lean approach. Or is there an entirely different way of 
> doing
> this?
>
> Torsten
>
>
> ---------------------------------------------------------------------
> 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: Can I use request or sitemap parameters in my page?

Posted by Torsten Schlabach <TS...@gmx.net>.
That's even more complex than putting a custom tag <content/> in my template
and have it replaced with the actual filename in an XSL.

> and transform the final.xml in .html

That would be an XSL stylesheet as well, wouldn't it?

Torsten

> use sitemap aggregation
> 
> to create a final .xml file from .xml fragments
> and transform the final.xml in .html
> 
> 
> -- stavros
> 
> 
> 
> On Tue, 13 May 2003, Torsten Schlabach wrote:
> 
> > Dear list,
> >
> > here is what I am trying to do:
> >
> > I want all HTML pages that are served through Cocoon to be wrapped into
> a
> > template which is a separate file. Therefore I wrote my template; let's
> assume
> > it look like this for simplicity:
> >
> > <html>
> > <head>
> > <title>This is Torsten's Website</titile>
> > <body>
> >
> > <!-- In real life there should be some left menu code here -->
> >
> > <xi:include href="thisiswheretheproblemis"/>
> >
> > </body>
> > </head>
> > </html>
> >
> > It is obvious that in the place where it says "thisiswheretheproblemis"
> I
> > would need to put in the name of the actual html file from the original
> > request.
> >
> > Can I do that? I can access sitemap parameters in XSL, but I think it's
> not
> > necessarily a lean approach. Or is there an entirely different way of
> doing
> > this?
> >
> > Torsten
> >
> >
> > ---------------------------------------------------------------------
> > 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
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Can I use request or sitemap parameters in my page?

Posted by Stavros Kounis <go...@osmosis.gr>.
use sitemap aggregation

to create a final .xml file from .xml fragments
and transform the final.xml in .html


-- stavros



On Tue, 13 May 2003, Torsten Schlabach wrote:

> Dear list,
>
> here is what I am trying to do:
>
> I want all HTML pages that are served through Cocoon to be wrapped into a
> template which is a separate file. Therefore I wrote my template; let's assume
> it look like this for simplicity:
>
> <html>
> <head>
> <title>This is Torsten's Website</titile>
> <body>
>
> <!-- In real life there should be some left menu code here -->
>
> <xi:include href="thisiswheretheproblemis"/>
>
> </body>
> </head>
> </html>
>
> It is obvious that in the place where it says "thisiswheretheproblemis" I
> would need to put in the name of the actual html file from the original
> request.
>
> Can I do that? I can access sitemap parameters in XSL, but I think it's not
> necessarily a lean approach. Or is there an entirely different way of doing
> this?
>
> Torsten
>
>
> ---------------------------------------------------------------------
> 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