xsl-list
[Top] [All Lists]

[xsl] multiple + empty output

2009-11-12 04:29:30
Hi, 
 
I'm using Saxon 9 and XSLT 2.0.
I want to split 1 input-file in several output-files.
The problem is that i get the multiple files plus 1 empty file.
 
Like this:
 
1_2006.xml --> stylesheet --> file1, file2, file3, 1_2006.xml
 
I don't want to create this empty 1_2006.xml :(
 
I've tried <xsl:output method="saxon:net.sf.saxon.event.Sink"/> but it
doesn't seem to work.
 
The stylesheet:

<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:saxon="http://saxon.sf.net/"; exclude-result-prefixes="#all">
<xsl:strip-space elements="zs_absatz"/>
<xsl:output method="saxon:net.sf.saxon.event.Sink"/>
<xsl:output method="xml" encoding="ISO-8859-1" name="output"/>
<!-- ========================================================== -->
<!-- Stylesheet: splitartikel -->
<!-- pro Beitrag eine Datei -->
<!-- ========================================================== -->
<xsl:template match="artikel">
        <xsl:variable name="filename">
                <xsl:text>../step12/MuR_</xsl:text>
                <xsl:value-of
select="format-number(descendant::jahrgang[1], '0000')"/>
                <xsl:text>_</xsl:text>
                <xsl:choose>
                        <xsl:when
test="not(contains(descendant::ausgabe[1], '-'))">
                                <xsl:value-of
select="format-number(descendant::ausgabe[1], '00')"/>
                        </xsl:when>
                        <xsl:otherwise>
                                <xsl:value-of
select="descendant::ausgabe[1]"/>
                        </xsl:otherwise>
                </xsl:choose> 
                <xsl:text>_</xsl:text>
                <xsl:value-of
select="format-number(descendant::seite-von[1], '000')"/>
                <xsl:if test="descendant::position">
                        <xsl:text>_</xsl:text>
                        <xsl:value-of select="descendant::position[1]"/>
                </xsl:if>
                <xsl:text>.xml</xsl:text>
        </xsl:variable> 

        <xsl:result-document href="{$filename}" format="output">
                <xsl:copy-of select="."/>
        </xsl:result-document> 
</xsl:template>
</xsl:stylesheet>
 

Idea anyone ?!

regards


Patrick Szabo
 XSLT-Entwickler 

Tel.: +43 (1) 534 52 - 1573 
Fax: +43 (1) 534 52 - 146 

Patrick(_dot_)Szabo(_at_)lexisnexis(_dot_)at

LexisNexis Verlag ARD Orac GmbH & Co KG
Marxergasse 25, 1030 Wien
FN 8333f, Handelsgericht Wien
http://www.lexisnexis.at/
 




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