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