How about writing that in C++:
Node html
{"html", {{ "lang", "pl" }}, { // tag with attributes
{"head", { // tag without attributes
{"title", {
"Page Title" // text node
}}
}},
{"body", {{ "style", "background-color: #fff;" }}, {
{"h1", {"Page Title"}},
{"div", {}} // empty tag
}}
}};
cout << html;
and getting that:
<html lang="pl">
<head>
<title>
Page Title
</title>
</head>
<body style="background-color: #fff;">
<h1>
Page Title
</h1>
<div />
</body>
</html>
Continue Reading… Comments