<?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>29960</bug_id>
          
          <creation_ts>2016-10-27 09:21:34 +0000</creation_ts>
          <short_desc>[xslt3.0] On the need to report static errors</short_desc>
          <delta_ts>2016-10-31 23:27:02 +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>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</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>abel.braaksma</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>127968</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-10-27 09:21:34 +0000</bug_when>
    <thetext>ACTION 2016-10-20-002: ABr to open a Bugzilla entry suggesting
detailed spec changes needed to meet the requirement to allow
processor modes which do not raise all possible static errors
(following on from our discussion of the thread starting at
https://lists.w3.org/Archives/Public/public-xsl-wg/2016Oct/0002.html (member only)

Since I&apos;m interested in getting this done I&apos;ll hijack the action.

The proposal is that we should permit a mode of operation in which a transformation can execute without reporting static errors in code that&apos;s not executed.

To put this in perspective, we&apos;ve done some trial DocBook runs that show about 12000 template rules being compiled, with fewer than 10% of these being executed - basically because most instance documents use a small subset of the vocabulary. Compiling the stylesheet takes an order of magnitude longer than actually doing the transformation on a typical input file; and many workflows will compile the stylesheet every time it is executed.

We therefore think users will benefit from a mode of operation in which static analysis of the body of a template rule takes place only on first execution.

But we recognize of course that during development, stylesheet developers want to have all static errors reported (perhaps up to some threshold).

The proposal is therefore to rewrite the paragraph in 2.13 Error Handling:

Errors classified in this specification as static errors must be signaled by all implementations: that is, the processor must indicate that the error is present. A static error must be signaled even if it occurs in a part of the stylesheet that is never evaluated. Static errors are never recoverable. After signaling a static error, a processor may continue for the purpose of signaling additional errors, but it must eventually terminate abnormally without producing a principal result .

as follows:

A processor MUST provide a mode of operation that takes a (putative) stylesheet package as input and enables the user to determine whether or not that package contains any static errors.

Note: The manner in which static errors are reported, and the behavior when there are multiple static errors, are left as design choices for the implementer. It is RECOMMENDED that the error codes defined in this specification should be made available in any diagnostics.

A processor MAY also provide a mode of operation in which static errors in parts of the stylesheet that are not evaluated can go unreported.

Note: For example, when operating in this mode, a processor might report static errors in a template rule only if the input document contains nodes that match that template rule. Such a mode of operation can provide performance benefits when large and well-tested stylesheets are used to process source documents that might only use a small part of the XML vocabulary that the stylesheet is designed to handle.

In the penultimate paragraph of section 2.13, change

Implementations must use the codes defined in these specifications when signaling errors, to ensure that xsl:catch behaves in an interoperable way across implementations.

to

Implementations must use the codes defined in these specifications when signaling dynamic errors, to ensure that xsl:catch behaves in an interoperable way across implementations.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127969</commentid>
    <comment_count>1</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-10-27 15:59:41 +0000</bug_when>
    <thetext>Good point on that last para.

Is it worthwhile adding a Note that errors in XML are outside of the scope of static errors and will likely be reported, but since creating an XDM from a source is implementation-defined, processor&apos;s behavior for XML errors, or whether these are corrected or ignored, is also implementation-defined.

(I&apos;m not saying I&apos;m considering running html-tidy to fix XSLT-XML or something, but externally parsed entities that aren&apos;t required and cannot be fetched could reasonably be ignored. Moreover, I think this already is implementation-defined.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127970</commentid>
    <comment_count>2</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-10-27 16:00:51 +0000</bug_when>
    <thetext>Putative? Alleged? ;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127973</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-10-27 17:01:30 +0000</bug_when>
    <thetext>Proposal accepted including the suggestion in comment 1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127990</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-10-31 23:27:02 +0000</bug_when>
    <thetext>The changes have been applied.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>