Skip to content

Commit

Permalink
Merge pull request qt4cg#1596 from michaelhkay/1592-elements-to-maps-…
Browse files Browse the repository at this point in the history
…refinements

1592 Rework rules for selecting a layout
  • Loading branch information
ndw authored Dec 3, 2024
2 parents 36da54b + 5386cf9 commit 380ec50
Show file tree
Hide file tree
Showing 2 changed files with 433 additions and 131 deletions.
30 changes: 15 additions & 15 deletions specifications/xpath-functions-40/src/function-catalog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25715,36 +25715,36 @@ return json-to-xml($json, $options)]]></eg>
"record", "sequence", "mixed", "xml"))</fos:type>
<fos:default>map{}</fos:default>
</fos:option>
<fos:option key="disable-layouts">
<fos:meaning>A list of layouts that will not be used for elements unless they are
selected explicitly. (Note that <code>mixed</code> and <code>xml</code>
layout cannot be disabled.)</fos:meaning>
<fos:type>enum("empty", "empty-plus", "simple", "simple-plus", "list", "list-plus",
"record", "sequence")*</fos:type>
<fos:default>()</fos:default>
</fos:option>
</fos:options>





<p>The principles for conversion from elements to maps are described
in <specref ref="element-layouts"/>.</p>
in <specref ref="id-element-layouts"/>, and the rules for selecting
an element layout for each element are given in <specref ref="id-selecting-element-layout"/>.</p>


<p>In general, an element node maps to a key-value pair in which the key represents the element name, and the
corresponding value represents the attributes and children of the element. In the case of a top-level element
(a node directly supplied in <code>$nodes</code>), the result will be a singleton map containing this key-value
(a node directly supplied in <code>$elements</code>), the result will be a singleton map containing this key-value
pair as its only entry. In the case of a descendant element, the key-value pair for a child element will be added
to the content representing its parent element, in a way that depends on the parent element's layout.</p>

<p>The representation of other kinds of node depends on the layout chosen for its parent element.</p>


</fos:rules>
<fos:errors>
<p>A dynamic error is raised if the selected layout rules require atomization of an element that does not have a typed
value (typically because it has been validated against an element-only content model): <errorref
class="TY" code="0012"/>.</p>
</fos:errors>
<!--<fos:notes>
<p>The namespace URI and local name of all elements and attributes is available in the JSON output.
Prefixes are not retained, and namespaces that are declared but not used are not retained.</p>

</fos:notes>-->

<fos:examples>
<fos:example>
<fos:test>
Expand Down Expand Up @@ -25806,9 +25806,9 @@ return json-to-xml($json, $options)]]></eg>
</fos:test>-->
</fos:example>
</fos:examples>
<fos:history>
<fos:version version="4.0">Proposed for 4.0; initial review on 2023-06-27.</fos:version>
</fos:history>
<fos:changes>
<fos:change><p>New in 4.0.</p></fos:change>
</fos:changes>
</fos:function>


Expand Down
Loading

0 comments on commit 380ec50

Please sign in to comment.