Hi all

I needed to have the redirect xalan extension open files in append mode as
well, so that multiple stylesheet templates could append output to the same
file. This was achieved by recompiling the xalan jar with the modified
Redirect.java, and by using the extension like:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
        xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
    extension-element-prefixes="redirect"
        >

<xsl:variable name="myfile" select="concat("whatever",'.','txt')"/>

<redirect:open select="$myfile" mkdirs="true" append="true"/>
<redirect:write select="$myfile">
....whatever....
</redirect:write>
<redirect:close select="$myfile"/>

later writes to this file will not truncate the file first, then.

Any comments welcome.

Kind regards
Jo van der Merwe


                J.P. van der Merwe

                Technical Consultant : Business Integration

                Dimension Data i-Commerce Software

                4Tel: +27 011 263 5244

                4Switchboard +27 011 263 5000

                4Mobile: +27 082 322 6406

                4Fax: +27 011 263 5301

                4Helpdesk +27 086 1100 686

                4Email [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>

                4Website <http://www.ic.didata.com/>



Attachment: Redirect.java
Description: Binary data

Reply via email to