Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorting in XQL query

Status
Not open for further replies.

andrey

Programmer
Jun 23, 2000
24
IL
Is there any way to sort data returned by XQL query? For example:

Set colNodes = objDOM.selectNodes("//SALES_LIST/SALE")

and sort the result by @saleDate, just like we can filter it with [@saleDate != '01 Jan 2002'].

Thank you
 
I dont think so. I beleive this is going to be implemented in XPATH 2 sometime but I don't know when, and I'm not sure if MS will include it in their IXMLdomdocument model any time soon, but you never know :)


A way around this would be to write a xslt document that simply created a new xml document from the old one and used the <xsl:sort> and <xsl:copy-of> tags to sort on the saleDate attribute and copy xml into a new document respectively. Using the IXMLDOMDOCUMENT model you can then transform the old document via the xslt processor into the sorted version.

I would provide an example but I'm busy atm, sorry.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top