Hi, I’m working with an xml file showed in the image above:
As you can see, the Element (second line) has an xmlns value.
I’m trying to obtain the value of the Element . These are the steps of my develope:
Assign to a variable called xDoc (XDocument Type) the value XDocument.Load(“My xml file”)
Assign to a variable called ElementCollection (system.collection.generic IEnumerable of XElement) the value xDoc.Descendants("Jv-Ins-Reinsurance ")
For each elem in ElementCollection, Write Line elem.value
The problem is that I’m not obtaining any value in ElementCollection and, If I delete the attributes of Jv-Ins-Reinsurance, it works perfectly. But I need to mantain this attributes
Can you help me, please?
I,ve tried to upload the xml file but I couldn’t because I’m a new user.
With this value, I’ll get another value from a Data Table and I had to replace the text “Please advise” (rounded in red in the image) with the value obtained in Data Table
But I’m not being able to get the first value and I think the problem is the namespaces in the root line.
As you can see in the xaml, I’m getting one only element and I don’t know if I’m doing something wrong.
If there is possibility there are multiple ReinsurerReference element (including parent element), need to get TechAccount elements first, then Contract elements, finally ReinsurerReference element.