forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sjur Moshagen <sju...@mac.com>
Subject Re: Q: Integrate multipage externally generated content
Date Tue, 22 Feb 2005 13:26:48 GMT
På 22. feb. 2005 kl. 14.40 skrev Ferdinand Soethe:

> RG> However, I have remembered another way of doing what you want to 
> do, it
> RG> is a new feature and currently undocumented other than at
> RG> http://issues.cocoondev.org/browse/FOR-417
>
> Cool. That looks just like the thing I was looking for. Will try to
> implement an example to understand it better. Would the fragments for
> site and tabs have the same header as the main files?

 From the author of that feature request: Here's a short example of how 
we have used it:-)

In site.xml:

<site xmlns="http://apache.org/forrest/linkmap/1.0" href="" 
label="MyProj" tab="" >
     <about label="Home" tab="Home" >
         <index   href="index.html" label="Index" description="Welcome 
to divvun.no" />
         <changes href="changes.html" label="Changes" description="The 
projects history" />
         <todo    href="todo.html" label="Todo" description="The plan 
for the project" />
     </about>

     <xi:include href="doc/site-frag.xml#xpointer(/tech/*)" 
xmlns:xi="http://www.w3.org/2001/XInclude"/>

</site>


In site-frag.xml:

<?xml version="1.0" encoding="UTF-8"?>
<tech>
   <techdoc href="doc/" label="Technical doc" tab="TechDoc">
     <index href="intro.html" label="Introduction" />
   </techdoc>
   <!-- add entries ad lib just as in site.xml -->
</tech>

The same for tabs.xml and tabs-frag.xml.

The outer element in both fragment files are required to make the files 
valid XML files. Hence the reference to the content of that element in 
the XInclude.

It works like a charm, and having the full power of XInclude makes for 
a very flexible solution.

Sjur


Mime
View raw message