This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26469 - [xslt 3.0] Streamed validation
Summary: [xslt 3.0] Streamed validation
Status: CLOSED WONTFIX
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Working drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-30 11:03 UTC by Michael Kay
Modified: 2014-08-01 21:17 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2014-07-30 11:03:11 UTC
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

<xsl:variable name="x">
  <xsl:copy-of select="..." validation="strict"/>
</xsl:variable>

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="validate(.)"

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

<xsl:flow>
  <xsl:document>
    <xsl:copy-of select="." validation="strict"/>
  </xsl:document>
  <xsl:apply-templates select="."/>
</xsl:flow>

where each child instruction of xsl:flow takes the result of the previous instruction as its input (i.e. as the context item)
Comment 1 Michael Kay 2014-08-01 10:49:34 UTC
Decided to close this as "won't fix". 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'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).
Comment 2 Innovimax 2014-08-01 21:17:40 UTC
As an additional comment, there is certainly room with using xsl:accumulator to do some ad hoc validation if needed