user518342
user518342

Reputation: 27

Is it possible to sort an XML file using XSL?

hello friends i had developed one project in .net first thing is that i create one request xml file in that all the data is there ... after that i got one response xml file from web . now i need to sort this xml file on the basis of requested input file ...

ex: itaniary=bom -del = flight=AI Arrivaltime=10.20

now i need to sort this xml file using xsl so which code is added in

Upvotes: 0

Views: 174

Answers (3)

Dimitre Novatchev
Dimitre Novatchev

Reputation: 243579

Is it possible to sort an XML file using XSL?

Yes. In more than one way.

When talking about sorting one needs to specify:

  1. Which exactly nodes need to be rearranged (sorted).

  2. what are the sorting keys - the expression over each node that when calculated gives its "value" to be used in the sorting operation.

  3. The comparator function -- in XSLT this is part of the expression, but may be omitted if the type of the sort keys allows the default lt operation.

  4. The order (ascending or descending) in which to present the result of the sort.

Read about the <xsl:sort> and the <xsl:perform-sort> instructions (the latter available only in XSLT 2.0).

Upvotes: 4

Amir Gonnen
Amir Gonnen

Reputation: 3727

Check out the XSLT <xsl:sort> Element.

Upvotes: 0

Wilfred Springer
Wilfred Springer

Reputation: 10927

If I look at the title only, I would say the answer is "yes".

Upvotes: 1

Related Questions