[daisy] conditionally show text on document

Bruno Dumon bruno at outerthought.org
Fri Sep 14 03:29:56 CDT 2007


On Thu, 2007-09-13 at 14:09 -0500, Parisi, Lou wrote:
> First let me apologize to this list for my many questions in the last
> week and thank you for your answers you have given me.  I hope you can
> give me a little more help.
> 
>  
> 
> I have created a daisy wiki home page and much of the information is
> not visible if the user is not logged in.  I would like to
> conditionally show some text to tell the user login with a link to the
> login if the user is guest.  
> 
>  
> 
> I found from some of the source stylesheets these snippets and tried
> to user them but they don’t seem to work for a SimpleDocument.  
> 
>  
> 
> <xsl:import href="daisyskin:xslt/document-to-html.xsl"/>
> 
>   <xsl:variable name="user" select="page/context/user"/>
> 
<snip/>

The important thing with XSLT is to know the XML structure of the input.

For the document-styling XSLTs, this is described here:

http://cocoondev.org/daisydocs-2_1/374-cd/g1/26-cd.html

As you can see, the root element is <document>, and below that is
<context>.

So the above XPath expression to get the user should be:

<xsl:variable name="user" select="document/context/user"/>

The other ones with reference $user should then automatically work.

BTW, the <page> root tag is what is used for the XML which is provided
to the layout.xsl, whose structure is described here: 
http://cocoondev.org/daisydocs-2_1/374-cd/25-cd/190-cd.html


-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno at outerthought.org                          bruno at apache.org



More information about the daisy mailing list