cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Smith" <msm...@windebt.com>
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
sidebar.

-----Original Message-----
From: Robin Green [mailto:greenrd@hotmail.com]
Sent: Thursday, September 14, 2000 5:58 PM
To: cocoon-users@xml.apache.org
Subject: Re: reusing xml elements?


"Matthew Smith" <msmith@windebt.com> wrote:
>Reply-To: cocoon-users@xml.apache.org
>To: "Cocoon List \(E-mail\)" <cocoon-users@xml.apache.org>
>Subject: reusing xml elements?
>Date: Thu, 14 Sep 2000 16:13:06 -0500
>MIME-Version: 1.0
>Received: from [63.211.145.10] by hotmail.com (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 cocoon-users-help@xml.apache.org; run by ezmlm
>Precedence: bulk
>X-No-Archive: yes
>list-help: <mailto:cocoon-users-help@xml.apache.org>
>list-unsubscribe: <mailto:cocoon-users-unsubscribe@xml.apache.org>
>list-post: <mailto:cocoon-users@xml.apache.org>
>	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
>I'm
>doing.
>
><xsl:template match="page">
><!-- page is the root element of the xml for the content -->
><xsl:processing-instruction
>name="cocoon-format">type="text/html"</xsl:processing-instruction>
>     <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:variable>
>             <xsl:for-each select="//menuhead[@name='{
>$thesection }']/menuitem">
>                 <a href="{@link}"><xsl:value-of select="menuhead"
>/></a><br
>/>
>             </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>
>
><xsl:template match="menu">
>     <!-- stuff to process the menu into dhtml drop down menus -->
>     <!-- menu is the root element, with menuheads inside that and
>menuitems
>inside those -->
></xsl:template>
>
>

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



_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.


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



Mime
View raw message