none
How to query xml using linq RRS feed

  • Question

  • discuss with a small example code that how to query xml using linq when xml is saved in string variable.
    Friday, July 21, 2017 12:40 PM

Answers

  • Hi Mou_kolkata,

    LINQ to XML is an up-to-date, redesigned approach to programming with XML. It provides the in-memory document modification capabilities of the Document Object Model (DOM), and supports LINQ query expressions. Although these query expressions are syntactically different from XPath, they provide similar functionality.

    For more information, please refer to LINQ to XML.

    https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/linq-to-xml-overview

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Mou_kolkata Monday, July 24, 2017 11:58 AM
    Monday, July 24, 2017 1:26 AM
    Moderator

All replies

  • discuss with a small example code that how to query xml using linq when xml is saved in string variable.

    The string variable would have to be loaded into  XML Document object and the XML using Linq querying the document object. There are plenty of examples you can find using Bing or Google.
    Friday, July 21, 2017 3:48 PM
  • Hi Mou_kolkata,

    LINQ to XML is an up-to-date, redesigned approach to programming with XML. It provides the in-memory document modification capabilities of the Document Object Model (DOM), and supports LINQ query expressions. Although these query expressions are syntactically different from XPath, they provide similar functionality.

    For more information, please refer to LINQ to XML.

    https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/linq-to-xml-overview

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Mou_kolkata Monday, July 24, 2017 11:58 AM
    Monday, July 24, 2017 1:26 AM
    Moderator