#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 = "
xml_encode() and xml_decode() convert between XML strings and element-shaped DValue values without schema validation.
= encoded ?>
= json_encode(decoded) ?>
= xml_encode(simple, "payload") ?>
Input XML:
= incoming ?>
Decoded DValue:
= json_encode(incoming_tree) ?>> }