refactor: rename DTree to DValue

This commit is contained in:
udo
2026-06-12 11:05:52 +00:00
parent 941f5aea08
commit 7066da3cde
157 changed files with 1203 additions and 1074 deletions
+9 -9
View File
@@ -2,31 +2,31 @@
RENDER(Request& context)
{
DTree book;
DValue book;
book["name"] = "book";
book["attrs"]["id"] = "b1";
book["attrs"]["type"] = "reference";
DTree title;
DValue title;
title["name"] = "title";
title["text"] = "UCE & XML";
book["children"].push(title);
DTree chapter;
DValue chapter;
chapter["name"] = "chapter";
chapter["attrs"]["number"] = "1";
chapter["text"] = "Structural conversion without schema validation.";
book["children"].push(chapter);
String encoded = xml_encode(book);
DTree decoded = xml_decode(encoded);
DValue decoded = xml_decode(encoded);
DTree simple;
DValue simple;
simple["title"] = "Hello";
simple["count"] = "3";
String incoming = "<note priority=\"high\"><to>UCE</to><body><![CDATA[5 < 6]]></body><symbol>&#x41;&#66;</symbol></note>";
DTree incoming_tree = xml_decode(incoming);
DValue incoming_tree = xml_decode(incoming);
<>
<link rel="stylesheet" href='style.css'></link>
@@ -35,12 +35,12 @@ RENDER(Request& context)
XML
</h1>
<p><code>xml_encode()</code> and <code>xml_decode()</code> convert between XML strings and element-shaped <code>DTree</code> values without schema validation.</p>
<p><code>xml_encode()</code> and <code>xml_decode()</code> convert between XML strings and element-shaped <code>DValue</code> values without schema validation.</p>
<h2>Encoded Element Tree</h2>
<pre><?= encoded ?></pre>
<h2>Decoded DTree</h2>
<h2>Decoded DValue</h2>
<pre><?= json_encode(decoded) ?></pre>
<h2>Simple Map Encoding</h2>
@@ -49,7 +49,7 @@ RENDER(Request& context)
<h2>Decode Existing XML</h2>
<p>Input XML:</p>
<pre><?= incoming ?></pre>
<p>Decoded DTree:</p>
<p>Decoded DValue:</p>
<pre><?= json_encode(incoming_tree) ?></pre>
<p>