Sorting ciatations within brackets

While working on in-text citations of the AMA style I stumbled on another problem.

The style organises all citations in the citation sequence (order). And it works perfectly.

But sometimes you have to use several citations in one place (inside brackets). Or you decide to add some citations to already existing ones.
For example: [122, 51, 32, 78].

According to the requirements of the university I work for - all numbers within brackets must be sorted from the lowest to the highest number: [32, 51, 78, 122].
Do you think it's possible to improve the XSL script so that the numbers are sorted in this way after updating the bibliography?

No. Due to a design flaw this is not possible. In-text citations are not aware of their neighbours or their position within a group. So it is not possible to write code to sort them, even if you would do it from scratch.

It might be possible to write a complex macro which grabs the field code for each citation field and then tries to sort them but that's going to be a lot of work as flags have to be taken into account.

It would be more comfortable if Word could show (display) those numbers in the citation list (the list which appears after clicking the Insert Citation button).
This way I could check the numbers assigned to citations I want to insert and add them in a desired order.

BTW, are there any improvements in Word 2010 comparing to 2007 in this area?

In your case, you probably want to use b:RefOrder over b:Tag and not take b:RefOrder into account when building your b:SortKey.

Not however that the numbers are pretty useless if the citations is not yet cited in the text as the number reflects the reference order. Uncited sources will just get a number higher than the highest cited one.

Hmm... You are right. The numbers are useful only for already cited sources.
I think the alphabetical order of the "Insert Citation..." list (with authors names) is the best idea since it is much easier to find a given source.
But some additional info in the list would be helpful. So maybe the best solution would be to display numbers and also (probably more useful) to somehow mark all cited sources.

The sources passed to the xsl are not aware of their environment. They have no idea if they have been cited or not.

The information on which sources have been cited and which have not is stored in the Word object model though. So in theory you could create your own dropdown in Word where you take this information into account. A lot of work, but doable.