Skip to content

Commit

Permalink
Fix: I put the new text in the wrong place.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhkay committed Aug 15, 2023
1 parent 41497dd commit a5fdb47
Showing 1 changed file with 56 additions and 45 deletions.
101 changes: 56 additions & 45 deletions specifications/xquery-40/src/query-prolog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -485,30 +485,68 @@ return (
or a <termref def="dt-module-import">module declaration</termref>
<errorref class="ST" code="0033"/>. </p>

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

<p diff="add" at="A">If the schema import declaration specifies <code>default element namespace</code>
then the prolog must not contain a <termref def="dt-namespace-declaration">namespace declaration</termref>
that specifies <code>default element namespace</code> or <code>default type namespace</code>.</p>

<p> The first <nt def="URILiteral">URILiteral</nt> in a schema import specifies the target
namespace of the schema to be imported.
The URILiterals that follow the <code>at</code>
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.
</p>
<p>
If the target
namespace is <code>http://www.w3.org/2005/xpath-functions</code> then the schema described in
<xspecref spec="FO31" ref="schemata"/> is imported; any location hints are ignored.
</p>
<p>The first <nt def="URILiteral">URILiteral</nt> specifies the target namespace of the schema documents to be
imported.</p>

<p>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 <errorref class="ST" code="0057"/>, 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", <phrase diff="chg" at="A">the only way to reference the definitions in an imported schema that has no
target namespace is using the EQName syntax <code>Q{}local-name</code></phrase>.</p>
target namespace is using the EQName syntax <code>Q{}local-name</code></phrase>.</p>

<p diff="chg" at="issue647">The <nt def="URILiteral">URILiterals</nt>
that follow the <code>at</code> 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 <rfc2119>may</rfc2119>
interpret or disregard these hints in an <termref def="dt-implementation-defined"
>implementation-defined</termref> way. The <rfc2119>recommended</rfc2119> strategy,
to be used by default unless the user dictates otherwise, is as follows:</p>

<olist diff="add" at="issue647">
<item><p>If the target namespace is one for which the processor has built-in knowledge,
for example the schema for a <termref def="dt-reserved-namespaces">reserved namespace</termref>, the location hints
<rfc219>should</rfc219> be ignored, and the built-in schema used in preference.</p></item>
<item><p>In other cases,
all the location hints are dereferenced, treating them as relative URIs relative
to the static base URI of the query module.</p></item>
<item><p>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.</p></item>
<item><p>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.</p></item>
<item><p>If multiple location hints are dereferenced, yielding multiple schema documents
<var>A</var>, <var>B</var>, and <var>C</var>, then they should be treated as if there were a
single schema document (in the requested target namespace) containing <code>xs:include</code>
declarations referencing <var>A</var>, <var>B</var>, and <var>C</var>. 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.</p></item>
<item><p>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 <rfc2119>should</rfc2119>
be ignored.</p></item>
</olist>

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

<p>
If the target
namespace is <code>http://www.w3.org/2005/xpath-functions</code> then the schema described in
<xspecref spec="FO31" ref="schemata"/> is imported; any location hints are ignored.
</p>

<p>It is a <termref def="dt-static-error">static error</termref>
<errorref class="ST" code="0058"/> if more than one schema import in the same <termref
def="dt-prolog">Prolog</termref> specifies the same target namespace. It is a <termref
Expand Down Expand Up @@ -603,38 +641,11 @@ return (
namespace <errorref class="ST" code="0033"/>.</p>
<p>The first <nt def="URILiteral">URILiteral</nt> in a module import must be of nonzero length
<errorref class="ST" code="0088"/>, and specifies the target namespace of the modules to be
imported.</p>

<p diff="chg" at="issue647">The <nt def="URILiteral">URILiterals</nt>
that follow the <code>at</code> 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 <rfc2119>may</rfc2119>
interpret or disregard these hints in an <termref def="dt-implementation-defined"
>implementation-defined</termref> way. The <rfc2119>recommended</rfc2119> strategy,
to be used by default unless the user dictates otherwise, is as follows:</p>
imported. The <nt def="URILiteral">URILiterals</nt> that follow the <code>at</code> keyword are
optional location hints, and can be interpreted or disregarded in
an <termref def="dt-implementation-defined"
>implementation-defined</termref> way.</p>

<olist diff="add" at="issue647">
<item><p>All the location hints are dereferenced, treating them as relative URIs relative
to the static base URI of the query module.</p></item>
<item><p>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.</p></item>
<item><p>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.</p></item>
<item><p>If multiple location hints are dereferenced, yielding multiple schema documents
<var>A</var>, <var>B</var>, and <var>C</var>, then they should be treated as if there were a
single schema document (in the requested target namespace) containing <code>xs:include</code>
declarations referencing <var>A</var>, <var>B</var>, and <var>C</var>. 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.</p></item>
<item><p>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 <rfc2119>should</rfc2119>
be ignored.</p></item>
</olist>

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

<p>It is a <termref def="dt-static-error">static error</termref>
<errorref class="ST" code="0047"/> if more than one module import in a <termref
Expand Down

0 comments on commit a5fdb47

Please sign in to comment.