[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: appending output to file using saxon
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|