Xml.XMLDoc.TXMLNode.GetPrefix
Delphi
function GetPrefix: DOMString;
C++
System::UnicodeString __fastcall GetPrefix();
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | protected | Xml.XMLDoc.pas Xml.XMLDoc.hpp |
Xml.XMLDoc | TXMLNode |
Description
Returns the namespace prefix of the node's name.
Use the TXMLNode object's IXMLNode interface to call the protected GetPrefix method. GetPrefix returns the namespace prefix of an element or attribute node's name. A namespace prefix is a symbolic name for a namespace URI.
For element nodes, the namespace prefix is derived from the name that appears in the XML tag. For example, the namespace prefix for <xsi:Name First="John" Last="Doe"> is 'xsi'.
For attribute nodes, the namespace prefix is derived from the string that appears to the left of the equals sign in the attribute declaration. For example the element <xsi:Name xsn:First="John" Last="Doe"> results in two attribute nodes, with namespace prefixes of 'xsn' and , respectively. Note that the attribute never inherits a namespace prefix from the node to which it is attached.
For any other node types, the namespace prefix is nil (Delphi) or NULL (C++).
Note: If both GetPrefix and GetLocalName return a value for a node, the node name (returned by GetNodeName) is the combination of these two values.