473,386 Members | 1,644 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,386 software developers and data experts.

XPath AddSort Question

DN
I'd like to pass multiple attributes to XPath AddSort like:

expr = nav.Compile(strQuery);
expr.AddSort(sortArray, XmlSortOrder.Ascending, XmlCaseOrder.None, "",
XmlDataType.Text);

But I get "Only objects returned from Compile() can be passed as input."

It works fine with a single field name or attribute, but I can't seem to
figure out how to pass multiple fields.

Any ideas?

Thanks
Nov 12 '05 #1
1 2215
I replied to this on another forum:

Hi,

you would need to concatenate the contents of multiple nodes using XPath's
concat function to create an XPath expression to be passed to the AddSort.
For example to sort by last name and first name

string key="concat(concat(lastname,','),firstname)";

Then pass this to the AddSort method. It will be evaluated as a string and
actual value will be used to sort nodes.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"DN" <as*****@hotmail.com> wrote in message
news:ub**************@TK2MSFTNGP11.phx.gbl...
I'd like to pass multiple attributes to XPath AddSort like:

expr = nav.Compile(strQuery);
expr.AddSort(sortArray, XmlSortOrder.Ascending, XmlCaseOrder.None, "",
XmlDataType.Text);

But I get "Only objects returned from Compile() can be passed as input."

It works fine with a single field name or attribute, but I can't seem to
figure out how to pass multiple fields.

Any ideas?

Thanks

Nov 12 '05 #2

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

Similar topics

0
by: Mark | last post by:
Hi, I have a web service that returns some XML based on a query made by the client. The order of this data is important and as such I use the following code to achieve this: XPathNavigator...
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...
6
by: Banski | last post by:
Hi, Im quite new to XML in .Net. Im getting values from an xml file using XPath and sorting as you see in the code below. I cant figure out how to get the value of date with GetAttribute. Hope...
4
by: viditmittal | last post by:
hi, i have a xml file <root> <Type /> <Description /> <Category /> <employee > <id>3</id>
1
by: DN | last post by:
I'd like to pass multiple attributes to XPath AddSort like: expr = nav.Compile(strQuery); expr.AddSort(sortArray, XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Text); But I get...
1
by: Loretta | last post by:
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? ...
3
by: Goran Djuranovic | last post by:
Hi All, Does anyone know how to retreive deepest XPath value from XML document by using VB.NET? For example, if I had an XML file like this: <Root> <Customer> <Name>MyName</Name> </Customer>...
0
by: Chazam | last post by:
What I'm Trying to do is sort By Date. I came up whith the idea of splite the date in year, month and day then sort them individualy. this work perfect in xsl <xsl:sort order ="descending"...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

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.