TXMLDocumentNodeIndentStr (C++)
Description
The following example uses the NodeIndentStr property.
Code
void Test_NodeIndentStr() {
const String identation = " ";
_di_IXMLDocument document;
_di_IXMLNode node;
document = interface_cast<Xmlintf::IXMLDocument>(new TXMLDocument(NULL));
document->Active = true;
document->NodeIndentStr = identation;
document->Options = document->Options +
(TXMLDocOptions() << doNodeAutoIndent);
// Uncomment the following line to see the formatting difference.
// document->Options = document->Options - (TXMLDocOptions() << doNodeAutoIndent);
// Create some nodes.
document->DocumentElement = document->CreateNode("GMC", ntElement);
node = document->DocumentElement->AddChild("SUV");
node->Text = "Typhoon";
// Display document content.
printf("%ls\n", document->XML->Text);
}
Uses
- Xml.XMLDoc.TXMLDocument.Active ( fr | de | ja )
- Xml.XMLDoc.TXMLDocument.NodeIndentStr ( fr | de | ja )
- Xml.XMLDoc.TXMLDocument.Options ( fr | de | ja )
- Xml.XMLDoc.TXMLDocument.CreateNode ( fr | de | ja )
- Xml.XMLDoc.TXMLDocument.XML ( fr | de | ja )