473,320 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Sorting with XPATH

Given an XML node List with the individual nodes looking like the following,
what kind of XPATH statement can I use to sort the nodes by element F8 and
inside F8 by element F3?

<OffNetworkRequestPackage>
<Transaction>
<OffNetworkRequest>
<OffNetworkData>
<UserEmail>lo****************@getronics.com</UserEmail>
<AdminEmail>NoEmail</AdminEmail>
</OffNetworkData>
<xxirequest>
<function uuid="SBPProcess" name="CBICashCheck" bpname="TellerStd"/>
</xxirequest>
<TF>
<F6 v="CBICashCheck" i="-1"/>
<F8 v="2005-12-12 00:00" i="-1"/>
<F260012 v="647856476538" i="0"/>
<F260007 v="111111" i="-1"/>
<F260282 v="102" i="-1"/>
<F3 v="191" i="-1"/>
<F313 v="706" i="-1"/>
</TF>
</OffNetworkRequest>
</Transaction>
<ReEntry>
<OffNetworkRequest>
<xxirequest>
<function uuid="SBPProcess" name="TellerReEntry" bpname="TellerReEntry"/>
</xxirequest>
<OffNetworkData>
<ReEntryData>
<Method>OffNet</Method>
<Bank>2740</Bank>
<Region>220</Region>
<Branch>507</Branch>
<Operator>STCA1\\lorettap</Operator>
<LCID>1033</LCID>
<StartDate>2005-12-12</StartDate>
<UserEmail>lo****************@getronics.com</UserEmail>
<AdminEmail>NoEmail</AdminEmail>
</ReEntryData>
</OffNetworkData>
</OffNetworkRequest>
</ReEntry>
</OffNetworkRequestPackage>

Loretta Pelissero

Dec 13 '05 #1
1 13312
Loretta wrote:
Given an XML node List with the individual nodes looking like the following,
what kind of XPATH statement can I use to sort the nodes by element F8 and
inside F8 by element F3?


XPath itself doesn't support sorting. But when you execute Xpath queries
in .NET you can sort using XPathExpression.AddSort method. See
http://msdn.microsoft.com/library/en...dsorttopic.asp

--
Oleg Tkachenko [XML MVP, MCAD]
http://www.XmlLab.Net | http://www.XLinq.Net | http://blog.tkachenko.com
Dec 14 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Philipp Lenssen | last post by:
I have this XML file which I would like to XSLT-sort based on the string contained within the item-children elements using basic MSXML (no recent version of IIS, so it might be an outdated MSXML --...
2
by: Ben Fidge | last post by:
Is it possible to sort the result of an XPath "select" query? I need to return a subset of a large xml file, and XPath is the way to go. I'd like to sort this subset afterwards? This seems...
4
by: moital | last post by:
i am looking for a c# way to sort an xmlDocument notes the input of the function is a xml as string, and a path of the to be sorted nodes and the attribute to sort by as any one implement...
1
by: Xavier Pacheco | last post by:
Sorting nodes/rows given the following xml: <top> <someelement/> <someotherelement/> <item> <sequence>5</sequence> <subitems>
5
by: Ben Fidge | last post by:
Hi, I've had an ASP project dumped on me written in VBScript. I'm actually a C#/ASP.NET developer and am struggling trying to find a way to sort the result of a XPath query executed using...
4
by: R | last post by:
Hi All, I have problem with sorting nodes I want sort them by columns c1, c2 also I have node <root><sort ActiveField="c0"/></root> ActiveField attribute is set by user. I'm sorting 'row'...
6
by: Christoph | last post by:
I'm trying to come up with a stylesheet where, when the rows are displayed, duplicate game names are not shown on subsequent rows. It works but doesn't work properly. If I sort the data using...
2
by: darrel | last post by:
We have a home grown web site. We store page information, including a time-stamp as to when it was last updated in a database table. We also store the site architecture (navigation) in an XML...
1
by: Lou | last post by:
How do I create an xpath expression to return a sorted nodelist? I need the sort to be by the attribute value. Example, If I have an xml list of names with "lastName" as an attribute <name...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.