Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "../libcobaltcore/xml.h"
- #include "../libcobaltcore/format.h"
- int main() {
- CoXMLDocument* doc = new CoXMLDocument (new CoXMLNode ("test", null));
- CoXMLNode* subnode = new CoXMLNode ("subnode", doc->root());
- subnode->setAttribute ("a", "hi!");
- subnode->setAttribute ("b", "test");
- CoXMLNode* test1 = new CoXMLNode ("test", subnode);
- CoXMLNode* test2 = new CoXMLNode ("test", subnode);
- CoXMLNode* test3 = new CoXMLNode ("test", subnode);
- CoXMLNode* test4 = new CoXMLNode ("test", subnode);
- test1->setContents ("This is a test non-<formatted> string");
- test1->setCDATA (true);
- test2->setContents ("Another test!");
- test3->setContents ("8)");
- test4->setContents ("1 + 2 = 3!");
- CoXMLNode::newSelfEnclosingNode ("subnodish", doc->root());
- return doc->save ("test-2.xml");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement