xsl-list
[Top] [All Lists]

RE: [xsl] no output files

2008-11-19 09:46:31
Another way to do the same, without worrying about 
implementation specifics is to enclose the transformation 
into an <xsl:variable/> (which means that nothing is to be 
done with this variable).

As this variable will capture the results of the 
transformation, no output will be produced.

Not so. The transformation

<xsl:template match="/">
  <xsl:variable name="x" select="2"/>
</xsl:template>

produces as its output a result tree consisting of a document node with no
children. If the transformation output is serialized and directed to a file
out.xml, the effect should be that after the transformation, out.xml exists
and contains only an XML declaration (regardless of whether or not the file
existed previously).

You can of course, as others have suggested, send the output to somewhere
where it does no harm. I was trying to answer the question more literally -
how do you arrange to produce no output in the first place.

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
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>
--~--

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