forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: XSL transformation as part of the page content?
Date Sun, 12 Feb 2006 14:59:32 GMT
Victor Okunev wrote:
> Hi All,
> 
> I have an XSLT style sheet that I use to generate an HTML table. Is it
> possible with Forrest v0.7 to perform the transformation as part of
> the site build and include the results under a document's section?
> Here is a pseudo code that kind of illustrates what I am after:
> 
> index.xml
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!--
>   Copyright....
> -->
> <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN"
> "http://forrest.apache.org/dtd/document-v20.dtd">
> <document>
>   <header>
>     <title>Page Title</title>
>   </header>
>   <body>
>     <section id="sectionid">
>       <title>Section Title</title>
>       <transform src="data.xml" stylesheet="table.xsl"/>
>     </section>
>   </body>
> </document>

An alternative to Davids approach, which in many (but not all) use cases 
is easier, is to use XInclude.

Here you would provide a sitemap match to generate your required data 
(see links in Davids mail) and then use XInclude in your source XML 
similar to your "transform" element above.

You can see examples of how to do this in the Chart plugin inthe whitebaord:

For example "samples/graph1.xml" in the plugin docs includes:

<!-- combine is the way the datasets are placed together. I imagine 
"compare", "add" will be\possible among others
<graph combine="compare">
   <style>
     <!-- Use the specified "style" sheet.
	Format of the url is yet to be specified. -->
     <xi:include href="linechart1.xml"/>
   </style>

Ross

Mime
View raw message