TXMLDocumentGeneratePrefix (C++)
Description
The following example uses the GeneratePrefix function and NSPrefixBase property.
Code
void Test_GeneratePrefix() {
TXMLDocument *document = new TXMLDocument(NULL);
document->Active = true;
// If the document element doesn't exist and the
// GeneratePrefix function is called, then an exception is raised.
_di_IXMLNode node = document->CreateNode("TestElement");
document->DocumentElement = node;
document->NSPrefixBase = "PrefBase";
String prefix; // DOMString class is not defined in C++.
prefix = document->GeneratePrefix(node);
printf("%ls\n", prefix);
delete document;
}
Uses
- Xml.XMLDoc.TXMLDocument.Active ( fr | de | ja )
- Xml.XMLDoc.TXMLDocument.CreateNode ( fr | de | ja )
- Xml.XMLDoc.TXMLDocument.NSPrefixBase ( fr | de | ja )
- Xml.XMLDoc.TXMLDocument.GeneratePrefix ( fr | de | ja )