Read XML and create objects using LINQ in VB.NET

0

With the following code below:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <escuelas>
    <escuela>
    <estudiante>noe</estudiante>
    <fechaCreacion>2017-11-21T00:11:26.748-05:00</fechaCreacion>
    <idE>1</idE>
    <nombre>joao</nombre>
    <profesor>maria</profesor>
    </escuela>
    </escuelas>
  

Note: I'm working with REST on a Web Service, so when I add a   new object the service returns me an xml with all objects, however,   I have not found a way to read this data yet.

    
asked by anonymous 21.11.2017 / 06:19

1 answer

0

To work with XML you have some tools available in the .Net Framework. Home The XPath and the XmlSerializer . In XmlSerializer you create a class structure that corresponds to the XML structure you are loading, using anotations to determine if the values are in elements or attributes, and calls the class's Deserialize method to load all the information into the structure that you have defined. Home If what you want is simply to search for one or more specific values within Xml, XPath is the most appropriate. The Link below explains how to use it:
link

Abs and good work!

    
21.11.2017 / 10:29