<?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>26469</bug_id>
          
          <creation_ts>2014-07-30 11:03:11 +0000</creation_ts>
          <short_desc>[xslt 3.0] Streamed validation</short_desc>
          <delta_ts>2014-08-01 21:17: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>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</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>innovimax+w3c</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>109561</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-07-30 11:03:11 +0000</bug_when>
    <thetext>In looking at the streamability of the xsl-to-json() we found that it is difficult to see how to validate the streamed input without creating an in-memory copy. If the stylesheet did the xsl:stream instruction itself then it could invoke validation at this point, but if it accepts streamed input from its caller then it cannot do this.

Also, xsl:stream can only validate the entire input stream, not selected parts of it.

Apart from xsl:stream, the only way to invoke validation is

&lt;xsl:variable name=&quot;x&quot;&gt;
  &lt;xsl:copy-of select=&quot;...&quot; validation=&quot;strict&quot;/&gt;
&lt;/xsl:variable&gt;

and this creates a grounded (in-memory) copy.

A possible solution might be a validate() function with the property that if the input is a streamed document, then the output is a streamed document, so one could do for example

xsl:apply-templates select=&quot;validate(.)&quot;

to apply validation to a stream without grounding it.

Another solution might be a more general mechanism for multi-phase streamed processing, this might allow something like

&lt;xsl:flow&gt;
  &lt;xsl:document&gt;
    &lt;xsl:copy-of select=&quot;.&quot; validation=&quot;strict&quot;/&gt;
  &lt;/xsl:document&gt;
  &lt;xsl:apply-templates select=&quot;.&quot;/&gt;
&lt;/xsl:flow&gt;

where each child instruction of xsl:flow takes the result of the previous instruction as its input (i.e. as the context item)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109747</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-08-01 10:49:34 +0000</bug_when>
    <thetext>Decided to close this as &quot;won&apos;t fix&quot;. We recognize that there are many use cases for multi-phase streaming and this is one, but the potential ramifications make it too risky (we don&apos;t have any functions currently that convert one stream of nodes into another stream of nodes, and the implications on streamability analysis are difficult to predict).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109774</commentid>
    <comment_count>2</comment_count>
    <who name="Innovimax">innovimax+w3c</who>
    <bug_when>2014-08-01 21:17:40 +0000</bug_when>
    <thetext>As an additional comment, there is certainly room with using xsl:accumulator to do some ad hoc validation if needed</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>