You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The attribute name <code>#isdn</code>, by contrast, is expanded using the
17039
+
The attribute name <code>#isbn</code>, by contrast, is expanded using the
17040
17040
<termref def="dt-no-namespace-rule"/>.</p></note>
17041
17041
17042
-
<note role="xquery"><p>XQuery 4.0 allows the node name to be written in quotation
17043
-
marks (for example, <code>element "book" {}</code>, and at the same
17042
+
<note role="xquery"><p>XQuery 4.0 allows the node name to be written as a QName literal
17043
+
(for example, <code>element #book {}</code>, and at the same
17044
17044
time it disallows the use of a defined set of language keywords
17045
17045
without quotes: for example <code>element div {}</code> was allowed
17046
17046
in XQuery 3.1 but must now be written <code>element #div {}</code> or
@@ -17826,7 +17826,9 @@ attribute {
17826
17826
</item>
17827
17827
</olist>
17828
17828
<p>No validation is performed on the constructed document node. The <bibref ref="XML"
17829
-
/> rules that govern the structure of an XML document (for example, the document node must have exactly one child that is an element node) are not enforced by the XQuery document node constructor.</p>
17829
+
/> rules that govern the structure of an XML document (for example, the
17830
+
document node must have exactly one child that is an element node)
17831
+
are not enforced by the &language; document node constructor.</p>
17830
17832
</div4>
17831
17833
<div4 id="id-textConstructors">
17832
17834
<head>Text Node Constructors</head>
@@ -17870,6 +17872,10 @@ attribute {
17870
17872
</note>
17871
17873
<p>The following example illustrates a text node constructor:</p>
<termref def="dt-in-scope-namespaces"/> of elements created using computed element constructors:</p>
18228
18226
18229
18227
<eg role="parse-test"><![CDATA[
18230
18228
element #age {
@@ -18235,13 +18233,19 @@ element #age {
18235
18233
}
18236
18234
]]></eg>
18237
18235
18238
-
<p role="xquery">In the above example, note that the <code>xsi</code> <termref def="dt-namespace-binding"/>
18239
-
is created for the element because it is used in an attribute name. The attribute’s
18240
-
content is simply character data, and has no effect on namespace bindings.
18241
-
The computed namespace constructor ensures that the <code>xs</code> binding is created.</p>
18242
-
18243
-
<p role="xquery">Computed namespace constructors have no effect on the <termref def="dt-static-namespaces"/>.
18244
-
If the prefix a is not already defined in the <termref def="dt-static-namespaces"/>,
18236
+
<p>In this example, the explicit construction of
18237
+
the <code>xsi</code> <termref def="dt-namespace-binding"/>
18238
+
is unnecessary; it would be created automatically, because the <code>xsi</code>
18239
+
prefix is used in an attribute name. By contrast, the declaration of
18240
+
the <code>xs</code> <termref def="dt-namespace-binding"/> is needed; the attribute’s
18241
+
content is simply character data, and would not trigger automatic creation
18242
+
of a namespace binding. This would be true even if the attribute is subsequently
18243
+
validated against a schema that interprets <code>"xs:integer"</code> as a QName,
18244
+
because such validation relies on the namespace binding already being present.</p>
18245
+
18246
+
<p role="xquery">Computed namespace constructors have no effect on the <termref def="dt-static-namespaces"/>
18247
+
in the static context.
18248
+
If the prefix <code>a</code> is not already defined in the <termref def="dt-static-namespaces"/>,
18245
18249
the following expression results in a static error
18246
18250
<errorref
18247
18251
class="ST" code="0081"/>.</p>
@@ -18252,6 +18256,13 @@ element #age {
18252
18256
}</a:form>
18253
18257
]]></eg>
18254
18258
18259
+
<note>
18260
+
<p>It is not possible to use a computed namespace constructor to
18261
+
generate a namespace undeclaration such as <code>xmlns=""</code>
18262
+
or (with XML Namespaces 1.1) <code>xmlns:p=""</code>. A namespace undeclaration in lexical XML
18263
+
is represented in the XDM model by the absence of a <termref def="dt-namespace-binding"/> that
18264
+
would otherwise be present.</p>
18265
+
</note>
18255
18266
18256
18267
</div4>
18257
18268
@@ -18388,7 +18399,7 @@ element #p:a {
18388
18399
}
18389
18400
</eg>
18390
18401
18391
-
<p>the <termref def="dt-in-scope-namespaces"/> of the resulting <code>p:a</code> element comprise
18402
+
<p>The <termref def="dt-in-scope-namespaces"/> of the resulting <code>p:a</code> element comprise
18392
18403
the following <termref def="dt-namespace-binding">namespace bindings</termref>:</p>
18393
18404
18394
18405
<slist>
@@ -18399,22 +18410,22 @@ element #p:a {
18399
18410
</slist>
18400
18411
18401
18412
18402
-
<p role="xquery">The <termref def="dt-namespace-binding">namespace bindings</termref> for <code>p</code> and <code>q</code>
18413
+
<p>The <termref def="dt-namespace-binding">namespace bindings</termref> for <code>p</code> and <code>q</code>
18403
18414
are added to the result element because their respective namespaces
18404
18415
are used in the names of the element and its attributes. The namespace binding <code>r="http://example.com/ns/r"</code> is added to the in-scope namespaces of the constructed
18405
18416
element because it is defined by a <termref
18406
18417
def="dt-namespace-decl-attr"
18407
18418
>namespace declaration attribute</termref>, even though it is not used in a name.</p>
18408
18419
18409
-
<p role="xquery">No <termref def="dt-namespace-binding"/> corresponding to <code>f="http://example.com/ns/f"</code> is created,
18420
+
<p>No <termref def="dt-namespace-binding"/> corresponding to <code>f="http://example.com/ns/f"</code> is created,
18410
18421
because the namespace prefix <code>f</code> appears only in the query prolog and is not used in an element
18411
18422
or attribute name of the constructed node. This namespace binding does not appear in the query result,
18412
18423
even though it is present in the <termref def="dt-static-namespaces"/> and is available for use
18413
18424
during processing of the query.</p>
18414
18425
18415
18426
<p role="xquery">Note that the following constructed element, if nested within a <code>validate</code> expression, cannot be validated:
0 commit comments