tags:

views:

181

answers:

1

Hi,

My application will process more than 10000 xml documents as batch. while processing I want to sort the content of xml documents. I came accross XpathExpression AddSort method, but how to use i to sort on multiple fields ? or using xslttranform will be appropriate ?? which is better in term of performance ??

Thanks in advance. Jon Kra

+1  A: 

Let me answer in backorder To choose between XPath and xsltransfor you should understand if xslt is enough to your batch processing. Most of xml operations can be done in xslt, so think about fully migrate.

Concerning to XPathExpression.AddSort. According to msdn: first argument can be XPathExpression, the second should be IComparer. This exposes your 2 ways.

  1. Let the XPathExpression to merge 2 or more fields to compare
  2. Let the XPathExpression select some "root" of compare and pass it to IComparer, that in order would extract from "root" expected fields to compare.
Dewfy