http://skew.org/xml/stylesheets/reindent/reindent.xsl
X++:
static void Test_XML(Args _args)
{
XMLDocument doc = XMLDocument::newBlank();
XMLElement html = doc.createElement('HTML');
XMLElement body = doc.createElement('BODY');
XMLElement table = doc.createElement('TABLE');
InventTable inventTable;
str prettyPrint(XMLDocument _xml)
{
XMLDocument xsl = XMLDocument::newFile(
@'D:\work\reindent.xslt')
;
return _xml.transformNode(xsl);
}
;
select firstOnly inventTable;
doc.appendChild(html);
html.appendChild(body);
body.appendChild(table);
table.setAttribute('TITLE', 'Test');
table.appendChild(doc.createTextNode('Test' + inventtable.itemid));
info(prettyPrint(doc));
}