You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Carlos Dias <cd...@pontoc.pt> on 2004/02/25 13:38:44 UTC

Use of Session Contexts

Hi all,
I need to implement a feature in my application that, I think, can make use of Session Contexts.
I have a XML file with the following information (menu.xml):
<MENU>
    <SUBMENU NAME="SUBMENU1">
        <REPORT NAME="REPORT1">       
        <REPORT NAME="REPORT2">       
    </SUBMENU>
    <SUBMENU NAME="SUBMENU2">
        <REPORT NAME="REPORT1">       
        <REPORT NAME="REPORT2">       
    </SUBMENU>
<MENU>

When the user selects a submenu the report that appears by default is the last one checked from the current menu. This can be done with "session contexts" right?!
My idea is to create a context with the following information:
<MENU>
    <SUBMENU NAME="SUBMENU1">
        <REPORT NAME="REPORT2">       (last selected report)
    </SUBMENU>
    <SUBMENU NAME="SUBMENU2">    (no report selected)
    </SUBMENU>
<MENU>

After the context creation the pipeline will do something like that:
<map:generate src="menu.xml"/>
<map:transform src="select_last_report_from _menu.xsl"/>
<map:serialize type="html"/>

Can I make a reference to the session context inside "select_last_report_from _menu.xsl"?! Something like 
<getxml context="mycontext" path=/MENU/SUBMENU[@NAME='REPORT1']/> 

Thanks,
Carlos Dias