title: Conditional Streaming Accumulator in XSLT 3
body: <p>With input XML like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Root&gt;
    &lt;Entry&gt;
      &lt;Amount&gt;2088&lt;/Amount&gt;
      &lt;DebitCredit&gt;C&lt;/DebitCredit&gt;
    &lt;/Entry&gt;
    &lt;Entry&gt;
      &lt;Amount&gt;9074&lt;/Amount&gt;
      &lt;DebitCredit&gt;D&lt;/DebitCredit&gt;
    &lt;/Entry&gt;
    ...
  &lt;/Root&gt;
  </code></pre>
  
  <p>I'd like to create a streamable transformation with separate accumulators for debits &amp; credits, but when I attempted to create an accumulator for one type or the other similar to this</p>
  
  <pre><code>&lt;xsl:accumulator name="debitcount" initial-value="0" streamable="yes"&gt;
      &lt;xsl:accumulator-rule phase="end" 
                            match="Entry[DebitCredit eq 'D']" 
                            select="$value + 1"/&gt;  
  &lt;/xsl:accumulator&gt;
  </code></pre>
  
  <p>I'm finding that apparently the sweep of any patterns in the match, select, or sequence constructor must be motionless. I'm able to access attribute values for the current element but not child elements or anything ahead of the current element.</p>
  
  <p>I'm wondering if what I'm trying to do is even possible with accumulators in streaming mode - I'm pretty sure I can accomplish what I'm aiming for here with iterator params, but it seems like a pretty big limitation if I'm understanding the docs correctly.</p>