<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>24606</bug_id>
          
          <creation_ts>2014-02-10 19:40:34 +0000</creation_ts>
          <short_desc>[xslt 3.0] Multi-pass streaming</short_desc>
          <delta_ts>2014-05-15 14:00:40 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XSLT 3.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>LATER</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>cmsmcq</cc>
    
    <cc>dnovatchev</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>100192</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-02-10 19:40:34 +0000</bug_when>
    <thetext>This thread in the December archives remains unresolved.

See https://lists.w3.org/Archives/Member/w3c-xsl-wg/2013Dec/0028.html (member only) and subsequent thread.

We do not really have a clean way of doing multi-pass streaming in the current spec (other than relying on external frameworks like XProc to combine multiple stylesheets, of course).

The classic way of defining a multi-pass transformation in XSLT is to use variables:

&lt;xsl:variable name=&quot;temp1&quot;&gt;
 &lt;xsl;stream href=&quot;input.xml&quot;&gt;
   &lt;some processing/&gt;
 &lt;/xsl:stream&gt;
&lt;/xsl;variable&gt;
&lt;xsl:apply-templates select=&quot;$temp1&quot; mode=&quot;streamable&quot;/&gt;

But there is nothing here to say that $temp1 should be processed as a stream; indeed we encourage the idea that streamed nodes are never bound to variables.

I would be tempted to suggest something like

&lt;xsl:pipeline&gt;
  &lt;xsl;stream href=&quot;input.xml&quot;&gt;
    ...
  &lt;/xsl:stream&gt;
  &lt;xsl;stream&gt;
    ...
  &lt;/xsl:stream&gt;
&lt;/xsl:pipeline&gt;

where each xsl:stream in the pipeline after the first takes its input from the result of the previous xsl:stream.

I&apos;m trying to look around for a solution that doesn&apos;t involve new syntax, but it&apos;s hard to find one. 

* Adding &quot;streamable=&quot;yes&quot; to xsl;variable is a possibility but it&apos;s still new syntax, and the rules for what it means and how it can be used are potentially quite tricky.

* Some kind of coupling of xsl:result-document and xsl:stream might be possible:

  &lt;xsl;result-document href=&quot;temp.xml&quot; method=&quot;pipe&quot;&gt;
    ...
  &lt;/xsl:result-document&gt;
  &lt;xsl;stream href=&quot;temp.xml&quot;&gt;
    ...
  &lt;/xsl:stream&gt;

* Or something like Saxon&apos;s next-in-chain:

&lt;xsl:result-document next=&quot;mode2&quot;&gt;
  &lt;xsl:stream href=&quot;input.xml&quot;&gt;
     ,,,
  &lt;/xsl:stream&gt;
&lt;/xsl:result-document&gt;

where the &quot;next&quot; attribute is a mode that is then used to process the result document.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100505</commentid>
    <comment_count>1</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2014-02-13 11:39:36 +0000</bug_when>
    <thetext>We discussed this at the WG meeting in Prague.

Some WG members noted that this has been a desiderata for some time.  Some felt that this was too big a change to make after going to Last Call.

The option of using XProc means that this really is a desideratum, not a pressing requirement.

Perhaps the WG should comment on the current XProc requirements document and suggest that support for streaming processing should be a requirement.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100622</commentid>
    <comment_count>2</comment_count>
    <who name="">dnovatchev</who>
    <bug_when>2014-02-14 21:15:15 +0000</bug_when>
    <thetext>Dear WG,

Please, kindly understand that not specifying useful functionality, because it *may* be implemented, is a user&apos;s hell.

At present XProc doesn&apos;t mandate any streaming, and leaves this entirely to each individual implementation.

From the XProc spec (http://www.w3.org/TR/xproc/#external-docs) :

 &quot;Whether (and when and how) or not the intermediate results that pass
 between steps are ever written to a filesystem is
 implementation-dependent.&quot;

Another recent bug resolution -- 24648 -- again leaves an important feature on the whim of a particular implementor.

So, we end up with: Implementation1(Feature1) and Implementation2(Feature2).

I feel sad for the user who needs both Feature1 and Feature2.

Hope to have an official reply that this user&apos;s hell is what the WG really plans for us.

Regards,
Dimitre Novatchev</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>