XmlNodeEventArgs.LocalName 属性

定义

获取正在被反序列化的 XML 节点的 XML 本地名称。Gets the XML local name of the XML node being deserialized.

public:
 property System::String ^ LocalName { System::String ^ get(); };
public string LocalName { get; }
member this.LocalName : string
Public ReadOnly Property LocalName As String

属性值

正在被反序列化的节点的 XML 本地名称。The XML local name of the node being deserialized.

示例

下面的示例打印调用 XmlSerializer 类的 Deserialize 方法时遇到的未知 XML 节点的 LocalNameThe following example prints the LocalName of an unknown XML node that is encountered when calling the XmlSerializer class's Deserialize method.

private:
   void serializer_UnknownNode( Object^ /*sender*/, XmlNodeEventArgs^ e )
   {
      Console::WriteLine( "UnknownNode LocalName: {0}", e->LocalName );
   }
private void serializer_UnknownNode
(object sender, XmlNodeEventArgs e)
{
   Console.WriteLine
   ("UnknownNode LocalName: " + e.LocalName);
}

Private Sub serializer_UnknownNode _
                    (ByVal sender As Object, _
                     ByVal e As XmlNodeEventArgs)                         
    Console.WriteLine("UnknownNode LocalName: " & e.LocalName)
End Sub

注解

LocalName 属性返回 XML 限定名称的本地名称(也称为本地部分)。The LocalName property returns the local name (also known as a local part) of an XML qualified name. LocalName 属性符合 1999 http://www.w3.org 规范 Namespaces in XMLThe LocalName property conforms to the 1999 http://www.w3.org specification Namespaces in XML.

适用于

另请参阅