This documentation is archived and is not being maintained.

XmlNodeEventArgs.NodeType Property

Gets the type of the XML node being deserialized.

[Visual Basic]
Public ReadOnly Property NodeType As XmlNodeType
[C#]
public XmlNodeType NodeType {get;}
[C++]
public: __property XmlNodeType get_NodeType();
[JScript]
public function get NodeType() : XmlNodeType;

Property Value

The XmlNodeType that represents the XML node being deserialized.

Remarks

The XmlNodeType enumeration returns a description of the node being deserialized. For example, it returns "Comment" if the node is a comment.

Example

[Visual Basic, C#, C++] The following example prints a description of the unknown node that caused the UnknownNode event to occur.

[Visual Basic] 
Protected Sub serializer_UnknownNode _
    (ByVal sender As Object, _
     ByVal e As XmlNodeEventArgs)
        Dim myNodeType As XmlNodeType = e.NodeType
        Console.WriteLine(myNodeType)
    End Sub

[C#] 
protected void serializer_UnknownNode
(object sender, XmlNodeEventArgs e)
{
   XmlNodeType myNodeType = e.NodeType;
   Console.WriteLine(myNodeType);
}
   

[C++] 
protected:
void serializer_UnknownNode(Object* /*sender*/, XmlNodeEventArgs* e)
{
   XmlNodeType myNodeType = e->NodeType;
   Console::WriteLine(myNodeType);
}
   

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

XmlNodeEventArgs Class | XmlNodeEventArgs Members | System.Xml.Serialization Namespace | Deserialize | XmlSerializer

Show: