xsl-list
[Top] [All Lists]

RE: [xsl] Appending to existing file

2007-07-17 03:55:24
From: "J. Zhang" <j(_dot_)zhang(_at_)uva(_dot_)nl>

I am writing my output to multiple files. However, I need to write my
output to existing files that have already been created. In Saxon I get
 an error:

XTDE1490: Cannot write more than one result document to the same URI, or
write to a URI

Simple question: How can you append to an existing file?

Write your output to a temporary file, then after XSLT finishes, use an operating system command (or programming language library command) to append the contents of the temporary file to the existing file.

Alternatively, you could read the existing file using an alias URI to get the existing contents, and then write it out as part of the transformation. This is quite likely to not work. (you might well find the existing contents to be empty).

_________________________________________________________________
The next generation of Hotmail is here! http://www.newhotmail.co.uk


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--