[Bug 29237] New: [xslt 3.0] Bug in CSV package example

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29237

            Bug ID: 29237
           Summary: [xslt 3.0] Bug in CSV package example
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 3.0
          Assignee: mike@saxonica.com
          Reporter: mike@saxonica.com
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

In the example CSV package in 3.5.7.8, we have a variable declaration

<xsl:variable name="csv:csv-quote-ok" visibility="private">
   <xsl:sequence select="
       if (string-length($csv:quote) ne 1) 
       then error(xs:QName('csv:ERR001'), 
                  'Incorrect length for $csv:quote, should be 1') 
       else ()" />
</xsl:variable>

and we say: 

When the value of csv:quote is suitable, the variable csv:csv-quote-ok will
evaluate to the empty sequence

But this is incorrect. Because the variable declaration has no "as" attribute,
the value is not an empty sequence but a childless document node.

I am fixing this by changing the variable declaration to:

<xsl:variable name="csv:csv-quote-ok" visibility="private" 
              as="xs:error?" select="
       if (string-length($csv:quote) ne 1) 
       then error(xs:QName('csv:ERR001'), 
                  'Incorrect length for $csv:quote, should be 1') 
       else ()" />

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

Received on Saturday, 24 October 2015 13:44:04 UTC