Retreive the node values from XML file in LINQ and C#

ac1d0x

New Member
I have a xml file and I want to retrieve the values from the \[code\]message\[/code\] attributes into a \[code\]string\[/code\] array from the below structure:\[code\]<Exceptions> <Exception Name="Address"> <Error id="Line1" message="Address Line 1 is required"/> <Error id="Line1Length" message="Address Line 1 must be in-between 1 and 50"/> <Error id="Line2Length" message="Address Line 2 must be in-between 1 and 50"/> </Exception> <Exception Name="Email"> <Error id="Line1" message="Email is required"/> </Exception></Exceptions>\[/code\]How can I do this using LINQ-XML?
 
Back
Top