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 28439 - [XT30TS] error-1620a
Summary: [XT30TS] error-1620a
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 Test Suite (show other bugs)
Version: Working drafts
Hardware: PC Windows NT
: 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-08 13:38 UTC by Tim Mills
Modified: 2015-04-15 18:04 UTC (History)
1 user (show)

See Also:


Attachments

Description Tim Mills 2015-04-08 13:38:55 UTC
The possible result for this test

            <assert-serialization><![CDATA[<out>&lt;a/&gt;</out>]]></assert-serialization>

is incorrect.  It should include an XML declaration.

There are a number of other tests which might be similarly affected in _output-test-set.xml and _error-test-set.xml in which <assert-serialization> is used with no method and the transformation produces XML (not XHTML or HTML).
Comment 1 Abel Braaksma 2015-04-08 15:16:50 UTC
Fixed by changing the assert-serialization to assert-xml (which gets rid of the declaration by itself).

It also appeared on error-1620b. Changes pushed.

> There are a number of other tests which might be similarly affected in 
> _output-test-set.xml and _error-test-set.xml in which <assert-serialization> 
> is used with no method and the transformation produces XML (not XHTML or HTML).

Leaving bug 'assigned', I have to look into those.
Comment 2 Tim Mills 2015-04-08 15:59:09 UTC
Confirmed fixed for error-1620b  Thanks.
Comment 3 Abel Braaksma 2015-04-15 18:04:45 UTC
After some trial and error, I came up with the following query:

/cat:test-set/cat:test-case
  [cat:result[assert-serialization
    [not(@method) or @method='xml']
    [
      (not(@file) and not(contains(., '?xml')))
      or not(contains(unparsed-text(@file), '<?xml'))
    ]
  ]]
[cat:test/cat:stylesheet
  [doc(@file)/(xsl:stylesheet|xsl:transform)
  [
    empty(xsl:output | .//xsl:result-document) or
    (xsl:output | .//xsl:result-document)[@method='xml' or empty(@method)]
      [normalize-space(@omit-xml-declaration)=('no', 'false', '0')]
  ]]
]

While I am not 100% sure the query is correct for all cases, it showed me three tests that were a candidate for incorrect settings:

include-0101
output-0312
output-0313

For all three cases these were false negatives. The test was about testing import precedence and the effective setting of omit-xml-declaration was true.

I'll resolve this bug as fixed, please reopen if you think the query above is wrong and/or if you find other tests that have the wrong serialized output as a result of the xml declaration.