XPathNodeIteratorExtensionsAsEnumerable Method
Enumerates all the XPathNavigator items in the
source XPathNodeIterator object,
and returns a IEnumerableT.
Namespace: DevCase.Extensions.XPathNodeIteratorExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static IEnumerable<XPathNavigator> AsEnumerable(
this XPathNodeIterator iterator
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function AsEnumerable (
iterator As XPathNodeIterator
) As IEnumerable(Of XPathNavigator)
Dim iterator As XPathNodeIterator
Dim returnValue As IEnumerable(Of XPathNavigator)
returnValue = iterator.AsEnumerable()
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static IEnumerable<XPathNavigator^>^ AsEnumerable(
XPathNodeIterator^ iterator
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member AsEnumerable :
iterator : XPathNodeIterator -> IEnumerable<XPathNavigator>
No code example is currently available or this language may not be supported.
- iterator XPathNodeIterator
-
The source XPathNodeIterator.
IEnumerableXPathNavigator
The resulting
IEnumerableT.
In Visual Basic and C#, you can call this method as an instance method on any object of type
XPathNodeIterator. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This is a code example.
No code example is currently available or this language may not be supported.
Dim xmlString As String =
"<?xml version=""1.0"" encoding=""UTF-8""?>
<root>
<element>
<name>Element 1</name>
<value>100</value>
</element>
<element>
<name>Element 2</name>
<value>200</value>
</element>
<element>
<name>Element 3</name>
<value>300</value>
</element>
</root>"
Using reader As TextReader = New StringReader(xmlString)
Dim xpathDocument As New XPathDocument(reader)
Dim navigator As XPathNavigator = xpathDocument.CreateNavigator()
Dim expression As XPathExpression = navigator.Compile("/root/element")
Dim iterator As XPathNodeIterator = navigator.Select(expression)
For Each node As XPathNavigator In iterator.AsEnumerable()
Console.WriteLine(node.OuterXml)
Next node
End Using
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.