Just i need to recreate a xml file after appling sorting on key filed element(say EmpID),The thing is ,i should not use ADO.NET.Which is the best sort to go ahead ?.To do so,What XML Class do i need to use?,LINQ is quite handy?
2 Answers
No need for c\ to do this. you can do it via an XSL file
<xsl:template match="/">
<xsl:apply-template select="yourlementnode">
<xsl:sort select="EmpID" order="ascending" />
</xsl:apply-template>
</xsl:template>
1 Comment
user158977
For display purpose will it sort? or physically ?
LINQ to XML would probably be your best bet. You could either move the elements "in place" or (possibly more easily) create a new document with the re-ordered elements.
If you can give us some sample XML (input and desired output) it should be fairly easy to come up with some example code.
2 Comments
user158977
How can i attach code file any attachement facility is available?
Jon Skeet
You need to indent code/XML by four spaces. See stackoverflow.com/editing-help