Subject: RE: [xsl] appending output to file using saxon From: "Bryan Rasmussen" <bry@xxxxxxxxxx> Date: Tue, 30 Apr 2002 09:18:27 +0200 |
Jakob Fix wrote: Is there a way to append content to an existing file using Saxon? Or any other way? hmm, not sure if I get the whole question here, but the above is clear enough, I gave a solution that allowed one to append content to a file several months ago, it can be found at: http://www.biglist.com/lists/xsl-list/archives/200201/msg01251.html but note the following posts to that and the controversy that ensued to see that, although this in fact worked it was a bad thing. here's the xslt again: <?xml version='1.0' encoding="utf-16"?> <xsl:stylesheet version='1.1' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' > <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> <xsl:template match="output"> <xsl:variable name="href"><xsl:value-of select="@file"/></xsl:variable> <xsl:param name="input" select="document($href)"/> <xsl:document href="{$href}" method="xml"> <root> <xsl:copy-of select="$input"/> <xsl:apply-templates/></root> </xsl:document> </xsl:template> <xsl:template match="p"> <para><xsl:value-of select="."/></para> </xsl:template> </xsl:stylesheet> Actually I'm glad that this came up because I wanted to take the subject up again and was contemplating a post. Given that the above solution is bad(side effects I take it being possible because $input which selects document($href) is output inside an xsl:document which generates $href, although I'd thought that as $input came before the xsl:document element it should be read in and side-effects be impossible), is there a possible solution whereby one can 'append' to a document in the way the one above does? XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] appending output to file usin, Jakob | Thread | RE: [xsl] appending output to file , Michael Kay |
RE: [xsl] document() and xpath, Meltem Kogelbauer | Date | Re: Re: [xsl] a newbie struggling, Peter Davis |
Month |