Outputting to separate files.

Subject: Outputting to separate files.
From: Alan Kennedy <alank@xxxxxx>
Date: Wed, 24 Mar 1999 10:49:01 +1100
XSL, Love it! Absolutely marvellous!

One small thing that I would love to have is the ability to redirect output
to a set of output files, directed by the StyleSheet.

For example, say I have a dictionary, like so

<DICT>

<ENTRY>
<WORD>Someword</WORD>
<DEF>Definition of someword</DEF>
</ENTRY>

<ENTRY>
.....
</ENTRY>

</DICT>

I'd like to be able to

<xsl:template match="DICT">
    <xsl:for-each select="ENTRY">
             <xsl:output-to filename="{.}.htm"/>
                 <xsl:apply-templates select="../DEF"/>
             </xsl:output-to>
    </xsl:for-each>
</xsl:template>

Could I do this with the existing XSL? Or would I have to roll my own using
the DOM? Or am I failing to grasp the concept of declarative transformation
(vs procedural)?

At the moment, I'm just maintaining my "dictionary" in a wodge of little
files and processing them all individually from the command line, which
means there is a lot of file opening and closing overheads.

Thanks for all the great work, XSL folks. You've radically changed the way I
work.

Regards,

Alan.





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


Current Thread