[Bug 25173] Test whether a streaming document is available through fn:streaming-document-available()


--- Comment #2 from Abel Braaksma <abel.braaksma@xs4all.nl> ---
During the telcon of 15 May 2014 this bugreport was discussed and the WG
requested what semantics the new function should have.

I propose to have it have the same semantics we currently use for reading a
streamed document: we currently say that a streamed document must buffer the
part up until the root element, and that the DTD, PI's and comments prior to
the root element must be buffered.

I think it makes sense to define it in terms of existing functionality,
similarly to the way the XPath function fn:doc-available is defined:

The function returns true if a streaming document is available.

fn:streaming-document-available($uri as xs:string?) as xs:boolean

This function is [non-deterministic], [context-dependent] and
[focus-independent], it depends on the static base uri.

If $uri is the empty sequence, this function returns false.

If the following construct returns true, this function returns true:
<xsl:stream href="{$arg}">
   <xsl:value-of select="has-children(root())" />

Error conditions (should we raise FODC0005 if the uri is not well-formed?)

Otherwise, this function returns false.

If this function returns true, implementers are encouraged to buffer the result
of reading up until the root element so that an <xsl:stream> instruction with
the same URI will succeed, even in scenario's where reading a streaming
document is forward-only. However, this behavior is not guaranteed for the same
reasons multiple invocations of <xsl:stream> on the same URI are not guaranteed

This means in practice that this function returns a positive hint that a
document is or is not available, but subsequent invocations using <xsl:stream>
with the same URI may still fail.

You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 15 May 2014 17:39:17 UTC