XML.com: XML From the Inside Out

XML.comWebServices.XML.comO'Reilly Networkoreilly.com
  Articles | Weblogs | Newsletter | Safari Bookshelf
advertisement

Article:
 Getting Started with XQuery, Part 2
Subject: XQuery and Sorted Lists
Date: 2005-04-13 19:07:34
From: Jay Alverson

I'm just getting started with Saxon after reading your articles.


I can do a fair amount for a beginner, but I'm having problems with "counting" the number of items that are output via a FOR...IN. I'm using the ORDER BY to sort them, which means their position() in the list changes.


Any advice on how to count the items as XQuery processes them?


Normally in a script you'd do something simple
like


Counter = Counter + 1


but XQuery doesn't work quite the same.


the full example is:


http://groups-beta.google.com/group/microsoft.public.xml/browse_frm/thread/5324e654c4ce1849/e3a4c5220436049c#e3a4c5220436049c


and I simply want to leave off the comma from the last item in the series of nodes.


Thanks, Jay Alverson


No Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • XQuery and Sorted Lists
    2005-04-14 06:25:09 Bob DuCharme [Reply]

    I'm sure there are mailing lists specific to XQuery discussions out there, and I know that there are mailing lists specific to Saxon use. Try asking at one of those mailing lists, and I'm sure you'll get an answer from someone who's solved the same problem before.


    Bob


Sponsored By:


Contact Us | Our Mission | Privacy Policy | Advertise With Us | | Submissions Guidelines
Copyright © 2008 O'Reilly Media, Inc. | (707) 827-7000 / (800) 998-9938