xsl-list
[Top] [All Lists]

RE: Returning the file name of the input file

2002-08-28 05:19:59


Jeni wrote:

<xsl:template match="file">
 <xsl:variable name="href" select="@href" />
 <saxon:output href="{$href}">
   <xsl:apply-templates select="document($href, .)" mode="process" />
 </saxon:output>
</xsl:template>

I'll note that it's probably a bad idea to read and write to/from the
same file -- if something goes wrong during the transformation you'll
probably end up losing all your data...

yes there was an argument about this a long time ago, okay a few months,
in which I caught the worst of it From Mr. Kay and Mr. Trevor Nash.
Although I've never really used this model it does seem to me to be
reasonably useful that one can do it if need be. It never really
thoroughly got through to me why it should be such a great sin as to
raise 'side effects', in the functional programming sense of the term,
but it seemingly does.
You can follow the chain below
http://sources.redhat.com/ml/xsl-list/2002-01/msg01337.html
they kicked me awful bad :¨| (just joking)

question: If one wanted to update a document using such a model should
one use a pipeline?
Load in document x, output to document y, load in document y, copy over
document x?


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



<Prev in Thread] Current Thread [Next in Thread>