[xsl] Creating multiple files

Subject: [xsl] Creating multiple files
From: "Kaarle Kaila" <kaarle.kaila@xxxxxx>
Date: Fri, 19 Dec 2003 18:16:51 +0200

I am studying XSLT and designing some reports in XML that I transform using
XSLT. I have ordered Michael Kays book from amazon because it got such good
reviews. I guess most my questions will be answered there??

I have an XML-file that contains something like this:

<table number="1">
table 1 contents
<table number="2">
table 2 contents

I wrote a few words about my plans at www.kk-software.fi/xmlreport . There
is also a more
complete xml-file available.

I use "XMLStarlet Toolkit: Command line utilities for XML" to translate my
xml-file to html using xslt stylesheets.

To create one html page from all tables my command is:
<xsl:for-each select=".">
with templates where needed.

I also need to create one file for each table-element.

By accepting the table number from the command line I can print one table
using these

<xsl:variable name="lno" select="$tabno"/>
<xsl:apply-templates select="//table[@number=$lno]" />

This seems to work. What happens when the xml-file is larger? Maybe 5000
This way might be then very slow as the toolkit needs to locate each of the
5000 tables
to create the outputs table1.html, table2.html, ..., table5000.html

Is there a way so that I could create all 5000 files in just one pass?

Kaarle Kaila

Kaarle Kaila
email: kaarle dot kaila at iki dot fi

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread