Get Attribute Values using LINQ to XML with Unknown Elements

zmjet

New Member
As part of a project I am working on I need to query XML files and find data based on search criteria. I have tried some examples using \[code\]XDocument\[/code\] but my issue is there are about 7 variations on the XML file needing parsed. So I don't know the element names, just what attributes the file might contain. for each variation I have concatenated the files into one file, it was my theory it would make searching easier. That theory so far has been proven wrong.All will have some or all of a list of Attributes. for example\[code\]<root> <T1> <T11 name="123"/> <H05 FileType="T52" ClientID="POB" /> </T1> <T1> <T11 name="1234"/> <H05 FileType="T2" ClientID="POB" /> <E1 ErrorCode="AA00" ErrorText="There was an Error" /> <E1 ErrorCode="BB00" ErrorText="There was another Error" /> </T1></root>\[/code\]If I wanted a collection of errors searching name, is it possible to search with LINQ using only attribute names found in the file?
 
Back
Top