This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The 60 test cases in "prod-OrderByClause" test set( http://dev.w3.org/cvsweb/2011/QT3-test-suite/prod/OrderByClause.xml?rev=1.8;content-type=text%2Fplain) that are using the "orderdata" environment are missing the corresponding import schema statement in the actual tests. The "orderdata" environment uses a validated document that is bound as context item but the tests are not importing the "http://www.w3.org/XQueryTestOrderBy" schema used to validate the context item.
It should not be necessary to import the schema unless the query actually references types in the schema by name. We make this much clearer in XQuery 3.0: form 2.5.5 "An XQuery 3.0 implementation must be able to determine relationships among the types in type annotations in an XDM instance and the types in the in-scope schema definitions (ISSD)." In other words, if a type annotation is present at run-time in the input document, that is supposed to tell the query processor all it needs to know about the type at run-time. You only need an import schema if the query processor needs compile-time information about types, and that's only needed if the query contains expression that refer to types by name.
As there has been no response to my comment #1 I am closing the bug as "invalid". Please re-open if you still feel the tests are wrong.