xsl-list
[Top] [All Lists]

AW: [xsl] multiple + empty output

2009-11-12 05:22:29
Thx for your answer !
Unfortunately the problem remains :(

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/
 
-----Ursprüngliche Nachricht-----

Von: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com] 
Gesendet: Donnerstag, 12. November 2009 11:11
An: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Betreff: RE: [xsl] multiple + empty output


Try adding <xsl:template match="/"><xsl:apply-templates
select="//artikel"/></xsl:template>

I suspect that the processing of the content outside (or between) the
artikel elements - perhaps only whitespace - is finding its way into the
so-called principal result tree. The output file for the principal result
tree is created only if you write something to it.

Regards,

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

-----Original Message-----
From: Szabo, Patrick (LNG-VIE) 
[mailto:patrick(_dot_)szabo(_at_)lexisnexis(_dot_)at] 
Sent: 12 November 2009 09:29
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] multiple + empty output

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



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




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