Skip to content

Commit 661d70d

Browse files
authored
Merge pull request qt4cg#2449 from michaelhkay/2445-xsi-attributes-in-element-to-map
2445 Add rules for xsi namespace elements in element-to-map
2 parents a31c78a + ecdd1bf commit 661d70d

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

specifications/xpath-functions-40/src/xpath-functions.xml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7479,7 +7479,7 @@ correctly in all browsers, depending on the system configuration.</emph></p>-->
74797479
<olist>
74807480
<item><p>Let <code>$EE</code> be
74817481
the set of all elements named <var>N</var>, specifically
7482-
<code>$input/descendant-or-self::*[node-name(.) eq <var>N</var>]</code>.</p>
7482+
<code>$input/descendant-or-self::*[node-name(.) eq <var>N</var>]</code>. </p>
74837483
</item>
74847484

74857485
<item>
@@ -7601,6 +7601,27 @@ correctly in all browsers, depending on the system configuration.</emph></p>-->
76017601

76027602
</div3>
76037603

7604+
<div3 id="id-xsi-attributes">
7605+
<head>Attributes in the <code>xsi</code> namespace</head>
7606+
<p>This section defines modifications to the above rules that apply to elements having
7607+
attributes in the <code>xsi</code> namespace (that is,
7608+
<code>http://www.w3.org/2001/XMLSchema-instance</code>).</p>
7609+
7610+
<ulist>
7611+
<item><p>When analyzing a corpus using <function>fn:element-to-map-plan</function>,
7612+
elements having the attribute <code>xsi:nil="true"</code> are ignored. If all
7613+
elements with a given name have this attribute, allocate the layout <code>mixed</code>.</p></item>
7614+
<item><p>When deciding whether an element has any attributes (for example to decide
7615+
between the layouts <code>empty</code> and <code>empty-plus</code>),
7616+
all attributes in the <code>xsi</code> namespace are ignored.</p></item>
7617+
<item><p>When converting an individual element to a map,
7618+
all attributes in the <code>xsi</code> namespace are ignored.</p></item>
7619+
<item><p>Notwithstanding the above, elements having the <code>nilled</code> property
7620+
(which essentially means they are schema-validated and have the attribute <code>xsi:nil="true"</code>),
7621+
are treated specially by each of the possible element layouts.</p></item>
7622+
</ulist>
7623+
</div3>
7624+
76047625
<div3 id="id-conversion-plan-structure">
76057626
<head>Structure of the conversion plan</head>
76067627

@@ -8014,6 +8035,9 @@ map( xs:string,
80148035

80158036
<item><p><emph>Element order: </emph> The order of child elements is lost when
80168037
<code>record</code> layout is used and the element has multiple children with the same name.</p></item>
8038+
8039+
<item><p><emph>XSI attributes: </emph> Attributes in the <code>xsi</code> namespace (for example,
8040+
<code>xsi:type</code> and <code>xsi:nil</code>) are not represented in the result. .</p></item>
80178041
</ulist>
80188042
</div3>
80198043

@@ -8093,18 +8117,7 @@ map( xs:string,
80938117
}
80948118
] }]]></eg></td>
80958119
</tr>
8096-
<!--<tr>
8097-
<td><eg><![CDATA[]]></eg></td>
8098-
<td><eg><![CDATA[]]></eg></td>
8099-
</tr>
8100-
<tr>
8101-
<td><eg><![CDATA[]]></eg></td>
8102-
<td><eg><![CDATA[]]></eg></td>
8103-
</tr>
8104-
<tr>
8105-
<td><eg><![CDATA[]]></eg></td>
8106-
<td><eg><![CDATA[]]></eg></td>
8107-
</tr>-->
8120+
81088121
</tbody>
81098122
</table>
81108123
<p>The following more complex example demonstrates a case where the default conversion is

0 commit comments

Comments
 (0)