Returns the previous sibling node of the current node.
…xmlnode_object.PreviousSibling
Prerequisites
None
Parameters
None
Remarks
This method returns a new XmlNode object that corresponds to the previous sibling of the current node. If there is no previous sibling, the returned object is Nothing. A sibling is a node that has the same parent as the current node. The order of siblings corresponds to the order of data items in the XML text document. This method does not create a new node in the DOM tree.
Examples
Dim doc As XmlDoc
Dim root As XmlNode
Dim elem1 As XmlNode
Dim elem2 As XmlNode
doc = New XmlDoc("my_doc")
root = doc.DocumentElement
elem1 = root.AddElementNode("section1", "Data for section 1")
elem2 = root.AddElementNode("section2", "Data for section 2")
Console.Writeline(elem2.PreviousSibling.Name) ' Displays "section1"
See Also
XML Classes| xmlnode_object.NextSibling | xmlnode_object.ParentNode