Parsing XML File

5 pts.
Tags:
XML
XPath
Below is the XML text:
101111.2111138.21111115.811111
DBOne

2201111.2111138.21111115.811111
DBTwo

Thisisatest
Thisisatest
Basically, I want to pull the text that has fqn . So, I want to get the following returned: table-[dbo].[Thisisatest] Thus far, this is what I have so far:
Dim xpathDoc As XPathDocument
Dim xmlNav As XPathNavigator
Dim xmlNI As XPathNodeIterator
xpathDoc = New XPathDocument("C:tempDeploymentsRFC-WestRequestjgtESTx.xml")

xmlNav = xpathDoc.CreateNavigator()

Dim query As XPathExpression = xmlNav.Compile("/*/*/")
Dim nodes As XPathNodeIterator = xmlNav.Select(query)
Dim nodesNavigator As XPathNavigator = nodes.Current
Dim nodestext As XPathNodeIterator = nodesNavigator.SelectDescendants(XPathNodeType.Text, False)
While nodestext.MoveNext
ListBox1.Items.Add(nodestext.Current.Value)
End While
When I execute it, I get:
101111.2111138.21111115.811111
DBOne
2201111.2111138.21111115.811111
DBTwo
Thisisatest
Thisisatest
Your input is greatly appreciated.
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: