Hi Ramesh,

Ramesh Chandra schrieb:
Thank you Andreas, I was also twiddling with the files a bit and I
was able to achieve the same effect by adding  <map:part
src="site:/{6}/leftmenu" element="lm"/> in the sitemap for
pattern="lenyabody-raw-*/*/*/*/*/*/**" and then used
<xsl:apply-templates select="lm/xhtml:html/xhtml:body/xhtml:[EMAIL PROTECTED] =
'leftmenu']"/> in page2xhtml.xsl.  Are there any pitfalls in using
this kind of approach rather than the simpler solution (using the
include transformer) that you had given?

I don't think there are any pitfalls, it's rather a matter of preference. If you like to declare the complete XML processing flow in the sitemap, <map:aggregate> is preferrable. I mostly use the include processor lately because it hels to keep the sitemaps less verbose.

-- Andreas


----- Original Message ---- From: Andreas Hartmann
<[EMAIL PROTECTED]> To: [email protected] Sent: Thursday,
October 16, 2008 4:15:10 AM Subject: Re: Newbie question - strategy
to develop a simple website

Hi Ramesh,

Ramesh Chandra schrieb:

So I am planning to use the following strategy.

1. Create the following documents which contain xhtml fragments a)/header b)/leftmenu c)/footer

2. Create documents for each page containing only the "Content"
part

3. Edit page2xhtml.xsl so that it would automatically include /header, /leftmenu and /footer automatically at appropriate positions.

4. /leftmenu, /header can be edited at any later time by the editor
 (without needing to tinker with xsl), so that the whole website is
 affected at one go.

The question is 'How do I implement Step 3'?

to include a document using its language and sitetree path, you can
use the IncludeTransformer [1] with the site protocol [2]:

<i:include src="site:/{$language}/footer"/>

[1] http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/transformation/IncludeTransformer.html
 [2]
http://lenya.apache.org/docu20/reference/protocols/siteprotocol.html

HTH, -- Andreas




--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to