cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve A Drake <...@comet.ucar.edu>
Subject Re: document(), xinclude or what ?
Date Mon, 09 Oct 2000 17:35:27 GMT
On Mon, 9 Oct 2000, Berin Loritsch wrote:

> 
> ----- Original Message ----- 
> From: "Steve A Drake" <sad@comet.ucar.edu>
> To: <cocoon-users@xml.apache.org>
> Sent: Monday, October 09, 2000 1:01 PM
> Subject: Re: document(), xinclude or what ?
> 
> 
> > On Mon, 9 Oct 2000, Berin Loritsch wrote:
> > 
> > > Can you give some example?
> > > 
> > > every time I try to use
> > > <xsl:apply-templates select="document('menu.xml')"/>
> > > I get only one layer deep (I have menu groups as well).
> > > I need the entire document to load.
> > 
> >  I had the same problem. I ended up building soft links to what you call
> > 'menu.xml'. This also has an advantage of avoiding hardwiring a path in
> > your XSL file.
> 
> Soft links?
> 
> Right now I am using xinclude to get menu.xml included.  It is a kludge,
> because that is something I want taken care of at XSL time.  Unfortunately,
> it is all done within the XML document itself.

 Yes, I also prefer using document() in the XSL file rather than xinclude
in the XML file. 

 As for soft links, if your server is some Unix variant, the command:

ln -s ../menu.xml menu.xml

creates a link, menu.xml, that points to ../menu.xml. So, you can then
use document('menu.xml') in your XSL file and use the link to point to the
actual location of the XML file.

I've included index.xml and index.xsl files that show how I'm using
document(). Equate your 'menu.xml' with my 'navbar.xml'. Note that I
pass in the name of the current document so that I can put a marker
next to it in the navigation bar. Hope this helps. Pass it back if you
make improvements!




Mime
View raw message