This documentation is archived and is not being maintained.
XmlNode::NextSibling Property
Visual Studio 2010
Gets the node immediately following this node.
Assembly: System.Xml (in System.Xml.dll)
Property Value
Type: System.Xml::XmlNodeThe next XmlNode. If there is no next node, nullptr is returned.
The following example displays all the books in the XML document.
#using <System.Xml.dll> using namespace System; using namespace System::Xml; int main() { XmlDocument^ doc = gcnew XmlDocument; doc->Load( "books.xml" ); XmlNode^ currNode = doc->DocumentElement->FirstChild; Console::WriteLine( "First book..." ); Console::WriteLine( currNode->OuterXml ); XmlNode^ nextNode = currNode->NextSibling; Console::WriteLine( "\r\nSecond book..." ); Console::WriteLine( nextNode->OuterXml ); }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: