What is the best way to read an XML file using Linux and you will see the code below, I have There are three different ends and I think it is not elegant or do I have the option to retrofit the code below?
Read public static zero XMLML output (stream stream) {XDocument xml = New XDocument (); Xml = LoadFormStream (stream); Var header = pml to xml.Elements ("app"). Select element ("apps") p; Foreign currency (different records in header) {String rules = records. Element ("Nemo"). Values; String description = record. Element ("Description"). Values; String name = record. Element ("name"). Values; String code = record. Element ("code"). Values; } Var appRoles = xml to q in. Elements ("app"). Element ("app"). Element ("apparel"). Select element ("role"); q; Forach (Vic record 1 in Aparol) {string name = record1.Element ("name"). Values; String Modified Name = Record 1 Element ("revised name") Values; Elements ("role" foreign currency (var record 2 in merbb) {string ExpirationDate = record2.Element ("end date") value; string fullName = record 2. element ("fullname"). Value;}} Renewed:
foreach (var record in header) {.............. string = 1 = record.Attribute (" Name ") value strings unformed names = records. Attribute (" unnamed name "); value; string ExpirationDate = record.Attribute (" ExpirationDate "). Value; string fullname = record. Attribute (" full name "). ; ...............}
It can not work properly in your case depending on the XML structure, try using P
var application = in XML. Disconnectents ("Applications") New {Nemo = P.Element (Select "Nemo"), Value, Description = p.Element ("Description") Value, Name = P. Element ("name") Value, Code = P. Element ("Code") Value}; var apperolles = x in xml discendant ("geo. Mika ") Select new {name = r.Element (" name "). Value, modified name = r Element ("revised name") Values};
Comments
Post a Comment