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 14831 - [QT3TS] parse-xml and serialize tests
Summary: [QT3TS] parse-xml and serialize tests
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Member-only Editors Drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: O'Neil Delpratt
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-15 08:24 UTC by Tim Mills
Modified: 2012-08-10 09:55 UTC (History)
3 users (show)

See Also:


Attachments

Description Tim Mills 2011-11-15 08:24:46 UTC
Many of these tests make a call to

unparsed-text("../docs/atomic.xml")

but the environment is empty.

I suggest rewriting the tests to use (for example)

unparsed-text("http://www.w3.org/fots/docs/atomic.xml")

and reference the "atomic" environment.
Comment 1 Michael Kay 2011-11-17 10:57:41 UTC
I can see why you would like this, so that unparsed-text() mirrors the way doc() is handled in the specs, but at present the spec of the two functions is different: doc() uses a mapping of URIs to resources in the static context, whereas unparsed-text() lacks this indirection: the spec is written to require direct resolution of the URI supplied. So I think this is a spec issue, not a test issue - the tests as written reflect the spec.
Comment 2 Tim Mills 2011-11-17 11:02:17 UTC
Should I raise this against the spec?

It would be a bit strange if

doc($uri)

is markedly different from

parse-xml(unparsed-text(
Comment 3 Tim Mills 2011-11-24 16:58:54 UTC
The fn:serialize tests actually use fn:doc, not fn:unparsed-text so need the fix I suggested.

   <test-case name="serialize-xml-001">
        <description>serialize test</description>
        <created by="ONeil Delpratt, Saxonica" on="2010-10-05"/>
        <environment name="empty"/>
        <test>serialize(doc('../docs/atomic.xml'))</test>
        <result>
            <assert>contains($result,'atomic')</assert>
        </result>
    </test-case>
Comment 4 O'Neil Delpratt 2012-05-22 10:05:43 UTC
Most of these tests have been rewritten.
Comment 5 Tim Mills 2012-05-31 14:50:20 UTC
The tests

serialize-xml-005
serialize-xml-007
serialize-xml-009

each use a serialization parameter document which is invalid with respect to the schema.

I expect the fn:serialize function to follow the process described in "3.1 Setting Serialization Parameters by Means of a Data Model Instance" at:

https://www.w3.org/XML/Group/qtspecs/specifications/xslt-xquery-serialization-30/html/Overview.html#serparams-in-xdm-instance

Thus setting a parameter will necessitate lax validation, and therefore each of these tests should expect SEPM0017.
Comment 6 Michael Kay 2012-07-25 02:23:30 UTC
For tests serialize-xml-005 and serialize-xml-009 I have changed the error code from SEPM0016 to SEPM0017 as suggested.

For test serialize-xml-007 I have anticipated the changes discussed by the WG today: it is expected that the schema will be changed to permit unrecognized elements in a "foreign" namespace but disallow those in the standard output namespace. I split the test into two to cover both cases.
Comment 7 Tim Mills 2012-08-10 09:55:45 UTC
Confirmed fixed.  Thanks.