cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Smith" <>
Subject RE: reusing xml elements?
Date Thu, 14 Sep 2000 22:19:52 GMT
	Thanks for offering the help, but I think I figured out how to do it.  I
haven't quite gotten it working right.  I think I'm having problems with
selecting nodes, but I'm trying to use modes.  I think this should solve it.
I just process the menu as normal and then I apply templates to a select of
the menuhead that equals the section with a different mode, to build the

-----Original Message-----
From: Robin Green []
Sent: Thursday, September 14, 2000 5:58 PM
Subject: Re: reusing xml elements?

"Matthew Smith" <> wrote:
>To: "Cocoon List \(E-mail\)" <>
>Subject: reusing xml elements?
>Date: Thu, 14 Sep 2000 16:13:06 -0500
>MIME-Version: 1.0
>Received: from [] by (3.2) with ESMTP id
>MHotMailBB8A8A37001FD82197B13FD3910A06250; Thu Sep 14 14:12:23 2000
>Received: (qmail 99280 invoked by uid 500); 14 Sep 2000 21:12:16 -0000
>Received: (qmail 99265 invoked from network); 14 Sep 2000 21:12:15 -0000
>From cocoon-users-return-8902-greenrd Thu Sep 14 14:14:43 2000
>Mailing-List: contact; run by ezmlm
>Precedence: bulk
>X-No-Archive: yes
>list-help: <>
>list-unsubscribe: <>
>list-post: <>
>	I'm trying to build a common menu from an xml menu on all pages processed,
>and then build a sidebar with links for the section the user is currently
>in.  I'd like to use the xml from the menu to build the sidebar, choosing
>which menu items to select from it by including a little <section> tag in
>the xml for each page.  The problem is that once I process the menu into a
>menu, that xml is gone, atleast that's what I think is happening.  Well,
>I'll put up some code from my xsl sheet that may make more sense of what
><xsl:template match="page">
><!-- page is the root element of the xml for the content -->
>     <html>
>     <head>
>         <!-- header stuff -->
>     </head>
>     <body>
>         <!-- page opening stuff -->
>             <xsl:apply-templates select="document('mainmenu.xml')"/>

This is matching on the mainmenu.xml file.

>         <!-- html that wraps around the sidebar -->
>             <xsl:variable name="thesection"><xsl:value-of select="section"
>             <xsl:for-each select="//menuhead[@name='{
>$thesection }']/menuitem">
>                 <a href="{@link}"><xsl:value-of select="menuhead"
>             </xsl:for-each>

Whereas this is all matching on the current input document. But don't you
want it to match on stuff in mainmenu.xml ? Or have I misunderstood?

>         <!-- html to close sidebar and open content -->
>             <xsl:apply-templates/>
>         <!-- page closing stuff -->
>     </body>
>     </html>
><xsl:template match="menu">
>     <!-- stuff to process the menu into dhtml drop down menus -->
>     <!-- menu is the root element, with menuheads inside that and
>inside those -->

Yes more clarification may be needed I think. More of your XSL and XML

Get Your Private, Free E-mail from MSN Hotmail at

Share information about yourself, create your own public profile at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message