XmlElement::LocalName Property
.NET Framework (current version)
Gets the local name of the current node.
Assembly: System.Xml (in System.Xml.dll)
Property Value
Type: System::String^The name of the current node with the prefix removed. For example, LocalName is book for the element <bk:book>.
The following example displays information on the ISBN element.
#using <System.Xml.dll> using namespace System; using namespace System::IO; using namespace System::Xml; int main() { XmlDocument^ doc = gcnew XmlDocument; doc->LoadXml( "<book xmlns:bk='urn:samples'>" "<bk:ISBN>1-861001-57-5</bk:ISBN>" "<title>Pride And Prejudice</title>" "</book>" ); // Display information on the ISBN element. XmlElement^ elem = dynamic_cast<XmlElement^>(doc->DocumentElement->FirstChild); Console::Write( "{0}:{1} = {2}", elem->Prefix, elem->LocalName, elem->InnerText ); Console::WriteLine( "\t namespaceURI={0}", elem->NamespaceURI ); }
Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Available since 10
.NET Framework
Available since 1.1
Show: