Export (0) Print
Expand All

XNode.IsAfter Method

Determines if the current node appears after a specified node in terms of document order.

Namespace:  System.Xml.Linq
Assembly:  System.Xml.Linq (in System.Xml.Linq.dll)

Public Function IsAfter ( _
	node As XNode _
) As Boolean


Type: System.Xml.Linq.XNode
The XNode to compare for document order.

Return Value

Type: System.Boolean
true if this node appears after the specified node; otherwise false.

The following example uses this method.

Dim output As New StringBuilder
Dim xmlTree As XElement = _
        <Root>Text content.
<Child1>child1 content</Child1>
            <Child2>child2 content</Child2>
            <Child3>child3 content</Child3>More text content.
<Child4>child4 content</Child4>
            <Child5>child5 content</Child5>

Dim child3 As XElement = xmlTree.<Child3>(0)
Dim child5 As XElement = xmlTree.<Child5>(0)
If (child5.IsAfter(child3)) Then
    output.Append("Child5 is after Child3")
    output.Append("Child5 is not after Child3")
End If

OutputTextBlock.Text = output.ToString()


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

© 2014 Microsoft