From a5fdb47a4c064662889f9b264e7b94d1f5aa6bbf Mon Sep 17 00:00:00 2001 From: Michael Kay Date: Tue, 15 Aug 2023 12:43:30 +0100 Subject: [PATCH] Fix: I put the new text in the wrong place. --- specifications/xquery-40/src/query-prolog.xml | 101 ++++++++++-------- 1 file changed, 56 insertions(+), 45 deletions(-) diff --git a/specifications/xquery-40/src/query-prolog.xml b/specifications/xquery-40/src/query-prolog.xml index f9fa21904..7c8087a80 100644 --- a/specifications/xquery-40/src/query-prolog.xml +++ b/specifications/xquery-40/src/query-prolog.xml @@ -485,30 +485,68 @@ return ( or a module declaration .

+ If schema definitions from the xml namespace + are to be used (for example, schema-attribute(xml:space), then the prolog should + include a declaration in the form import schema "http://www.w3.org/XML/1998/namespace". + No prefix should be supplied (the xml prefix is predeclared), and no location hint + should be provided (the schema definitions for the namespace are built in, and cannot be varied). +

If the schema import declaration specifies default element namespace then the prolog must not contain a namespace declaration that specifies default element namespace or default type namespace.

-

The first URILiteral in a schema import specifies the target - namespace of the schema to be imported. - The URILiterals that follow the at - keyword are optional location hints, and can be interpreted or disregarded in an - implementation-dependent way. Multiple location hints might be used to indicate more than one - possible place to look for the schema or multiple physical resources to be assembled to form - the schema. -

-

- If the target - namespace is http://www.w3.org/2005/xpath-functions then the schema described in - is imported; any location hints are ignored. -

+

The first URILiteral specifies the target namespace of the schema documents to be + imported.

+

A schema import that specifies a zero-length string as target namespace is considered to import a schema that has no target namespace. Such a schema import must not bind a namespace prefix , but it may set the default element and/or type namespace to a zero-length string (representing “no namespace”), thus enabling the definitions in the imported namespace to be referenced. If the default element and/or type namespace is not set to "no namespace", the only way to reference the definitions in an imported schema that has no - target namespace is using the EQName syntax Q{}local-name.

+ target namespace is using the EQName syntax Q{}local-name.

+ +

The URILiterals + that follow the at keyword are + optional location hints, intended to allow a processor to locate schema documents containing + definitions of the required schema components in the target namespace. Processors may + interpret or disregard these hints in an implementation-defined way. The recommended strategy, + to be used by default unless the user dictates otherwise, is as follows:

+ + +

If the target namespace is one for which the processor has built-in knowledge, + for example the schema for a reserved namespace, the location hints + should be ignored, and the built-in schema used in preference.

+

In other cases, + all the location hints are dereferenced, treating them as relative URIs relative + to the static base URI of the query module.

+

If any location hint cannot be dereferenced, then that location hint is disregarded + (optionally with a warning); but if none of the location hints can be dereferenced, then + a static error is reported.

+

If dereferencing any location hint yields a resource that cannot be parsed as a valid + XSD schema document with the correct target namespace, then a static error is reported.

+

If multiple location hints are dereferenced, yielding multiple schema documents + A, B, and C, then they should be treated as if there were a + single schema document (in the requested target namespace) containing xs:include + declarations referencing A, B, and C. This implies that the + several schema documents must together comprise a valid schema, for example there cannot be two + different type definitions with the same name.

+

Notwithstanding the previous rule, if a processor is able to establish that two or more + location hints refer to identical or equivalent schema documents, then the duplicates should + be ignored.

+
+ +

Processors that adopted a different strategy in earlier releases may + continue to use that strategy by default, in order to retain compatibility; however such + processors should offer the above strategy as an option.

+ +

+ If the target + namespace is http://www.w3.org/2005/xpath-functions then the schema described in + is imported; any location hints are ignored. +

+

It is a static error if more than one schema import in the same Prolog specifies the same target namespace. It is a .

The first URILiteral in a module import must be of nonzero length , and specifies the target namespace of the modules to be - imported.

- -

The URILiterals - that follow the at keyword are - optional location hints, intended to allow a processor to locate schema documents containing - definitions of the required schema components in the target namespace. Processors may - interpret or disregard these hints in an implementation-defined way. The recommended strategy, - to be used by default unless the user dictates otherwise, is as follows:

+ imported. The URILiterals that follow the at keyword are + optional location hints, and can be interpreted or disregarded in + an implementation-defined way.

- -

All the location hints are dereferenced, treating them as relative URIs relative - to the static base URI of the query module.

-

If any location hint cannot be dereferenced, then that location hint is disregarded - (optionally with a warning); but if none of the location hints can be dereferenced, then - a static error is reported.

-

If dereferencing any location hint yields a resource that cannot be parsed as a valid - XSD schema document with the correct target namespace, then a static error is reported.

-

If multiple location hints are dereferenced, yielding multiple schema documents - A, B, and C, then they should be treated as if there were a - single schema document (in the requested target namespace) containing xs:include - declarations referencing A, B, and C. This implies that the - several schema documents must together comprise a valid schema, for example there cannot be two - different type definitions with the same name.

-

Notwithstanding the previous rule, if a processor is able to establish that two or more - location hints refer to identical or equivalent schema documents, then the duplicates should - be ignored.

-
- -

Processors that adopted a different strategy in earlier releases may - continue to use that strategy by default, in order to retain compatibility; however such - processors should offer the above strategy as an option.

It is a static error if more than one module import in a