Link to home
Start Free TrialLog in
Avatar of disrupt
disruptFlag for United States of America

asked on

VB .NET XML Parsing String

I'm trying to bind a method that returns a xml string to a XML Document, but I get the following error
"XML axis properties do not support late binding".  The GetXML method retrieves a xml string from a website, what is the proper way to do this?
Dim doc = XDocument.Load(GetXML())

Dim query = _
           From c In doc.<tm>.<ts> _
           Select c.@id
        
For Each result In query
idList.Add(result)
Next

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aplusexpert
aplusexpert

Dim doc = XDocument.LoadXML(GetXML())

Dim query = _
           From c In doc.<tm>.<ts> _
           Select c.@id
       
For Each result In query
idList.Add(result)
Next
Did you try changing this line in your code:

Dim doc = XDocument.Load(GetXML())

to this, which explicitly defines doc as a XDocument :

Dim doc As XDocument = XDocument.Load(GetXML())

Fernando