none
Namespace breaks ability to search on XElement RRS feed

  • Question

  • If I search an XElement that does not have a namespace then this code works:

    Dim address As IEnumerable(Of XElement) = _ From el In root.<Address> _ Where el.@Type = "Billing" _ Select el ForEach el As XElement In address Console.WriteLine(el) Next

    But if there is a namespace attribute in the root node, then the same code cannot find the value of any child node.

    What do I have to do differently when a namespace is part of my XElement root?

    (That code snippet comes from http://msdn.microsoft.com/en-us/library/bb387041.aspx )

    John Bailo RR Donnelley


    • Edited by John Bailo Friday, March 28, 2014 9:19 PM
    Friday, March 28, 2014 9:18 PM

Answers

  • I think the following link will help you.

    http://blogs.msdn.com/b/wriju/archive/2008/05/29/linq-to-xml-querying-xml-with-namespaces.aspx


    Lloyd Sheen

    Saturday, March 29, 2014 2:37 PM