Re: AW: Sort directory-list

On 21/11/2024 16:59, Martin Honnen wrote:
> Of course you can try the function argument of fn:sort as already
> suggested


Here is an example


   <p:for-each>
     <p:with-input select="//*:file => sort((), function($file) {
analyze-string($file!@name, '[0-9]+')!descendant::*[not(*)]!(if (.
instance of element(fn:match)) then number(.) else string(.)) })"/>
     <p:identity/>
   </p:for-each>

Tested that with MorganaXProc-IIIse 1.4.5 to give e.g. 'sample1.xml',
'sample2.xml', `sample10.xml' where unsorted gives sample1.xml,
sample10.xml, sample2.xml

Received on Thursday, 21 November 2024 17:37:18 UTC