.net - Sort XML with C# Before Write -


I have an XML document that I am composed below from loop and XML author to C #. It works fine in the present, but I wanted to implement the solution where XML is written every time, it automatically attempts to use the Drive Start area. I know people say that you should do it in XSLT, but there is a hard time finding a good example for me to follow, is there any experience of any person using it? Any help is very appreciative.

  XmlDocument doc = New XmlDocument (); XML Element RN = Dock Crelet Element ("drive layout"); XML Element DN = Faucet; XmlAttribute xa, xa1, xa2, xa3, xa4, xa5, xa6; Doc.AppendChild (RN); Foreign (grid item item in it. File systemgrid.items) {dn = doc.CreateElement ("drive"); Xa = doc.CreateAttribute ("drivetime"); Xa.Value = item ["DriveTime"]. ToString (); Xa1 = doc.CreateAttribute ("DriveStart"); Xa1.Value = Item ["Drive Start"]. Toasting (); Xa2 = doc.CreateAttribute ("drive-end"); Xa2.Value = item ["DriveEnd"]. ToString (); } Dn.SetAttributeNode (xa); Dn.SetAttributeNode (XA1); Dn.SetAttributeNode (xa2); Rn.AppendChild (dn); Return doc.InnerXml; Sort your collection with your drivestart before using XML Writer. 


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -