#include "demo_guard.h" RENDER(Request& context) { DValue book; book["name"] = "book"; book["attrs"]["id"] = "b1"; book["attrs"]["type"] = "reference"; DValue title; title["name"] = "title"; title["text"] = "UCE & XML"; book["children"].push(title); 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); DValue decoded = xml_decode(encoded); DValue simple; simple["title"] = "Hello"; simple["count"] = "3"; String incoming = "UCEAB"; DValue incoming_tree = xml_decode(incoming); <>

UCE Test: XML

xml_encode() and xml_decode() convert between XML strings and element-shaped DValue values without schema validation.

Encoded Element Tree

Decoded DValue

Simple Map Encoding

Decode Existing XML

Input XML:

Decoded DValue:

xml_encode() docs | xml_decode() docs

}