Skip to content

Commit

Permalink
Merge pull request qt4cg#753 from michaelhkay/Issue65-xquery-default-…
Browse files Browse the repository at this point in the history
…namespace

65: Allow xmlns="xxx" to NOT change the default namespace for NameTests
  • Loading branch information
michaelhkay authored Oct 31, 2023
2 parents 8649197 + 846b7e2 commit d8ae4f7
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 137 deletions.
6 changes: 6 additions & 0 deletions specifications/grammar-40/xpath-grammar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,9 @@ VersionDecl ::= "xquery" (("encoding" StringLiteral) | ("version" StringLiteral
<g:string>=</g:string>
</g:sequence>
<g:sequence>
<g:optional>
<g:string>fixed</g:string>
</g:optional>
<g:string>default</g:string>
<g:string>element</g:string>
<g:string>namespace</g:string>
Expand Down Expand Up @@ -556,6 +559,9 @@ VersionDecl ::= "xquery" (("encoding" StringLiteral) | ("version" StringLiteral

<g:production name="DefaultNamespaceDecl" if=" xquery40">
<g:string>declare</g:string>
<g:optional>
<g:string>fixed</g:string>
</g:optional>
<g:string>default</g:string>
<g:choice name="DeclareDefaultElementOrFunction">
<g:string process-value="yes">element</g:string>
Expand Down
20 changes: 11 additions & 9 deletions specifications/xquery-40/src/back-matter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1466,24 +1466,28 @@ specification since the publication of XPath 3.1 Recommendation.</p>
improve interoperability, XQuery 4.0 recommends (but does not mandate)
a specific strategy for interpreting these hints.</p></item>


<item role="xquery"><p>The rules for the consistency of schemas imported by different query modules,
and for consistency between imported schemas and those used for validating input documents, have
been defined with greater precision. It is now recognized that these schemas will not always be
identical, and that validation with respect to different schemas may produce different outcomes,
even if the components of one are a subset of the components of the other.</p></item>

<item><p>Element and attribute tests of the form <code>element(N)</code>
and <code>attribute(N)</code> now allow <code>N</code> to be any <code>NameTest</code>,
including a wildcard.</p></item>
<item role="xquery"><p>The <termref def="dt-default-namespace-elements-and-types"/> can now be declared to be fixed
for a query module, meaning it is unaffected by a namespace declaration appearing on a direct
element constructor.</p></item>

</olist>

<p>The following changes are present in this draft, but are awaiting review and agreement:</p>
<olist>
<item><p>The static context now allows the default namespace for elements and
the default namespace for types to be different. XSLT 4.0 takes advantage of this,
XQuery 4.0 currently does not.</p></item>

<item><p>A new <code>with</code> expression allows namespace bindings to be defined
within an expression (and to be redefined in nested expressions).</p></item>
<item><p>The static context now allows the unprefixed function names to be resolved
using an arbitrary algorithm, rather than requiring the resolution to use a
default namespace.</p></item>

<item><p>The rules for reporting type errors during static analysis have been changed
so that a processor has more freedom to report errors in respect of constructs that
are evidently wrong, such as <code>@price/@value</code>, even though dynamic evaluation
Expand All @@ -1495,9 +1499,7 @@ specification since the publication of XPath 3.1 Recommendation.</p>
<item><p>Enumeration types are added as a new kind of <code>ItemType</code>, constraining
the value space of strings.</p></item>

<item><p>Element and attribute tests of the form <code>element(N)</code>
and <code>attribute(N)</code> now allow <code>N</code> to be any <code>NameTest</code>,
including a wildcard.</p></item>



<item><p>The lookup operator <code>?</code> can now be followed by a string literal, for cases where
Expand Down
Loading

0 comments on commit d8ae4f7

Please sign in to comment.