Xml.XMLDoc.TXMLDocument.GeneratePrefix

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GeneratePrefix(const Node: IXMLNode): DOMString;

C++

System::UnicodeString __fastcall GeneratePrefix(const Xml::Xmlintf::_di_IXMLNode Node);

Properties

Type Visibility Source Unit Parent
function public
Xml.XMLDoc.pas
Xml.XMLDoc.hpp
Xml.XMLDoc TXMLDocument

Description

Generates a unique namespace prefix that can be used for a node in the document.

Call GeneratePrefix to generate a new namespace prefix that is not already used in the document to represent a namespace URI. GeneratePrefix uses the NSPrefixBase property to generate a unique string to act as a namespace prefix. This unique string consists of NSPrefixBase followed by a number that ensures uniqueness. Thus, for example, if NSPrefixBase is 'NS', automatically generated namespace prefixes have the form 'NS1', 'NS2', and so on.

Node is the interface for the node that will use the newly generated namespace prefix.

The generated namespace prefixes are only unique within a single document. If two document components have the same value for NSPrefixBase, they will generate the same namespace prefixes.

See Also

Code Examples