1

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 2

4

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>
Sign up to request clarification or add additional context in comments.

1 Comment

For display purpose will it sort? or physically ?
0

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

How can i attach code file any attachement facility is available?
You need to indent code/XML by four spaces. See stackoverflow.com/editing-help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.