This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
document function
- To: XSL-List at mulberrytech dot com
- Subject: document function
- From: "Beckers, Marc" <Marc dot Beckers at softwareag dot com>
- Date: Thu, 10 Feb 2000 17:17:22 +0100
- Reply-To: xsl-list at mulberrytech dot com
Hello XSLers,
my question is this:
How can I use XSL, the document() function and XT's xt:document extension
to overwrite XHTML pages structured in
directories and subdirectories with copies of themselves?
I have got this far:
1. I have a script that I point at a directory. It runs
through all the subdirectories and writes me a list of files
in an XML "mother" document, for example:
<mother>
<file>files\overview.htm</file>
<file>files\book1\page1.htm</file>
<file>files\book1\chap1\page2.htm</file>
</mother>
2. In the XSL stylesheet I run against the above XML file using XT,
I can enter each *.htm as follows:
<xsl:template match="mother">
<xsl:for-each select="file">
<xsl:apply-templates select="document(.)"/>
</xsl:for-each>
</xsl:template>
3. I can now handle the contents of these files with templates
(actually I want to filter content out of the files and copy
the result back to where the original file was):
<xsl:template match="*">
<xsl:call-template name="filter"/>
</xsl:template>
4. Now I wish to create my output tree (as HTML files):
<xsl:template match="html">
<xt:document method="html" href="(each html instance becomes an HTML file
at the
location indicated by the corresponding file element in the "mother"
document) ">
<html>
<xsl:apply-templates/>
</html>
</xt:document>
</xsl:template>
How can I recreate my original file structure as reported in the
XML mother document with the filtered copies?
Grateful for any hints,
Dr. Marc Beckers
Documentation Consultant
Software AG
Uhlandstraße 12
D-64297 Darmstadt
Phone +49-6151-92-1322
Fax -1612
mailto:Marc.Beckers@softwareag.com
Internet www.softwareag.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list