Good morning. I have the following code that reads an xml, and collects the data and stores it in a variable.
private void leerxml(){
xElement rootnode= xelement.load(@"C:/xml.xml");
foreach (xElement chlid in RootNode.Elements())
{
if(chield.Name.Localname.Equals("datos"))
{
string xml = child.Value.Tostring();
Debug.Log(xml)
}
}
}
My Xml is this:
<libro>
<libroEjemplo>
<nombre>Alfredo Reino</nombre>
<email>[email protected]</email>
</libroEjemplo>
<libroEjemplo>
<nombre>Alfredo Reino</nombre>
<email>[email protected]</email>
</libroEjemplo>
</libro>
In the xml variable, when I hit the Debug.log (xml) it takes this:
Alfredo Reino [email protected]
Alfredo Reino [email protected]
I need to take the data separately, so I can use it in another class, but I do not know how to take the data individually and then use it individually to show it in different places. If someone has any ideas .. Thanks in advance