You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "T. V. Raman" <tv...@almaden.ibm.com> on 2000/09/07 00:26:16 UTC

redirect:write and friends: possible bug

I posted a note earlier today about redirecting outputs
--had sent that after searching the docs in vain--
later I found redirect:write 
in the main extensions page.

I now have my slides translator working --thanks!--
and in hte process spotted a possible bug when having
multiple simultaneous streams open.

I am generating a table of contents slide --as well as
individual html pages for each slide --using a two pass
transform via call-template.

If I call the table of contents genrator first --this
results in the toc file being open while the rest of the
slides are processed --and  due to what I suspect is a bug, 
the toc slide never receives all its output.
If you have that output go to stdout --then all the output
does show up --so I suspect someone is not flushing some
stream.

If I rearrange the call order in the style rule the bug is
avoided.
Here is what I mean:

The following works 
<xsl:template match="slides">
<!-- first process all slides --writing each to a separate
file -->
<xsl:apply-templates />
<!-- now finally write out the table of contents -->
<redirect:write file="index.html">
    <xsl:call-template name="toc"/>
    </redirect:write>
  </xsl:template>

The above bombs --
<xsl:template match="slides">
<!-- start writing out the Table of contents -->
<redirect:write file="index.html">
    <xsl:call-template name="toc"/>
    </redirect:write>
<xsl:apply-templates />

  </xsl:template>

-- 
Best Regards,
--raman
------------------------------------------------------------

IBM Research: Human Language Technologies
Phone:        1 (408) 927 2608
Fax:        1 (408) 927 3012
Email:        tvraman@us.ibm.com
WWW:      http://www.cs.cornell.edu/home/raman
PGP:          http://cs.cornell.edu/home/raman/raman.asc 
Snail:        IBM Almaden Research Center,
              650 Harry Road
              San Jose 95120