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 28581 - [xslt30ts] test set "static": whitespace
Summary: [xslt30ts] test set "static": whitespace
Status: RESOLVED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 Test Suite (show other bugs)
Version: Last Call drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Abel Braaksma
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-29 09:47 UTC by Michael Kay
Modified: 2015-04-30 15:20 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2015-04-29 09:47:18 UTC
Tests in the new "static" test set have incorrect whitespace in their expected results. For example static-001 does

   <xsl:template name="xsl:initial-template" expand-text="yes">
      {$static-param}
   </xsl:template>

and expects a result which is the value of $static-param, without any surrounding whitespace. The spec contains nothing which suggests the whitespace should be stripped, indeed it says:

"Fixed parts consisting entirely of whitespace are significant and are handled in the same way as any other fixed part. This is different from the default treatment of "boundary space" in XQuery."
Comment 1 Abel Braaksma 2015-04-29 17:07:35 UTC
Yes, the literal result will have extra whitespace for these tests.

Please note that these tests use assert-string-value assertions and that the documentation of that assertion says:

    Asserts that the result of the test, after conversion to a string by 
    applying the expression string-join(for $r in $result return 
    string($r), " ") is equal to the string value of the assert-string-value 
    element. Note that this test cannot be used if the result includes items 
    that do not have a string value (elements with element-only content; 
    function items).

    If the normalize-space attribute is present with the value true (which is 
    the default), then both the string value of the query result and the 
    value of the assert-string-value element should be processed as if by the 
    XPath normalize-space() function before the comparison. Otherwise, 
    normalization does not take place.

This is different from the QT3 test-suite, where the default is "no". The reasoning behind this is that in most tests, esp. with XSLT, extra whitespace can be added to result tree, as in these examples and ignoring the extra whitespace makes for easier tests. Oonly in some situations, not whitespace-normalizing makes sense and then you can either set this explicitly, or you can use assert-xml, assert-eq or other assertions.
Comment 2 Abel Braaksma 2015-04-29 17:09:39 UTC
In addition to the above, the XT3 Catalog Schema reflects this default for the normalize-space attribute:

<xs:simpleContent>
    <xs:extension base="xs:string">
        <xs:attribute name="normalize-space" type="xs:boolean" default="true"/>
    </xs:extension>
</xs:simpleContent>
Comment 3 Michael Kay 2015-04-30 15:20:35 UTC
Thanks, we have changed our test driver accordingly.