Link to home
Start Free TrialLog in
Avatar of ALawrence007
ALawrence007

asked on

Find node in XML using Linq

Hi to all,

I included a sample XML document that I am using. I need to be able to find the following in the XML:
<w:bookmarkStart w:id="0" w:name="testingTOCbookmark" />
Using LINQ.

I am using Visual Basic and it is a WPF Visual Studio 2008 Application.

Any help would be appreciated.

Thanks
Sample.xml
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

I think you can use XML Literals in WPF!
Something like this:

        Dim doc = XDocument.Load("l:\sample.xml")
        Dim elem = doc...<w:bookmarkStart>.Where(Function(f) f.@w:id = "0").FirstOrDefault()
        Debug.WriteLine(elem.@w:name)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal 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 ALawrence007
ALawrence007

ASKER

Worked perfect.
Thanks jpaulino!!
Glad I could help!