You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stephan Niedermeier <s....@projektinter.net> on 2003/03/20 14:44:04 UTC
BestPractice: Navigation
Hello,
I would like to realize a layer based navigation. Each entry may have 0...n sublevels. The XML, which describes this navigation looks like the following:
<navigation>
<entry url=http://foo" name="Foo">
<entry url=http://bar" name="Bar" />
</entry>
</navigation>
Secondly, there exists an XML, which describes the content of the page itself:
<page>
<title>Blabla</title>
<content>This is the content</content>
</page>
Now, I have got problems to bring the navigation informations dynamically into the XSL. I would like to describe each site in the sitemap and aggregate the navigation-XML and the page-XML:
<map:match pattern="foo">
<map:aggregate element="page">
<map:part src="xml/navigation.xml" />
<map:part src="xml/page.xml" strip-root="true" />
</map:aggregate>
<map:transform type="xsl" src="xsl/page2html.xsl" />
<map:serialize type="html" />
</map:match>
Now, I would like to get the name of the actual position on the page. Like this: "You are in area: Foo". Therefore I have to compare the given navigation path with the navigation.xml and extract the content of a element called "name" or/and "url" for example.
In my own opinion, I have two choices but I don't know which one of these works well...
The first one is to give the XSL the actual path of the position via <map:parameter> in <map:transform>. Is this possible?
The second one is to write an own action class/XSP, which gets the actual path via parameter, extracts the necessary informations from the navigation.xml and returns the values as attributes.
The main question is: How can I extract the specified content of navigation.xml depending on a parameter?
Is there a better way, to realize this? A best practice?
Thank you very much.
Regards
Stephan Niedermeier
Re: BestPractice: Navigation
Posted by Andrew Savory <an...@luminas.co.uk>.
Hi Stephan,
On Thu, 20 Mar 2003, Stephan Niedermeier wrote:
> I would like to realize a layer based navigation. Each entry may have
> 0...n sublevels. The XML, which describes this navigation looks like the
> following:
>
> Is there a better way, to realize this? A best practice?
Take a look at the Forrest project which deals with this and other issues:
http://xml.apache.org/forrest/
See in particular: http://xml.apache.org/forrest/linking.html
Also, take a look at the way the cocoon documentation is built, which
deals with multiple level navigation.
Hope that helps,
Andrew.
--
Andrew Savory Email: andrew@luminas.co.uk
Managing Director Tel: +44 (0)870 741 6658
Luminas Internet Applications Fax: +44 (0)700 598 1135
This is not an official statement or order. Web: www.luminas.co.uk
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org