[oXygen-user] Treating Selected Project Resources as XQuery Collection?

George Bina
Thu May 5 14:12:12 CDT 2016


I see... in my case all the results had only one digit. Then indeed, 
using the format-number() makes it easy to sort. We do not store type 
information in the results view, so the description is a string, thus 
the sorting results that you noticed.

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 05/05/16 21:58, Eliot Kimber wrote:
> If the results aren't padded the sorting appears to be lexical, that is 9
> sorts before 1000.
>
> Cheers,
>
> E.
> ----
> Eliot Kimber, Owner
> Contrext, LLC
> http://contrext.com
>
>
>
>
> On 5/5/16, 1:50 PM, "George Bina" <> wrote:
>
>> Hi Eliot,
>>
>> The scope basically executes the XPath expression on each file from the
>> working set, but the sorting on the results view should work also
>> without the need to use the format-number function... I tried on a few
>> files an XPath like
>>
>> /*/count(*)
>>
>> and then I clicked on the Description column to sort the results and
>> that worked fine.
>>
>> Best Regards,
>> George
>> --
>> George Cristian Bina
>> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
>> http://www.oxygenxml.com
>>
>> On 05/05/16 21:38, Eliot Kimber wrote:
>>> It looks like if I format my result as a number padded with zeros then I
>>> can sort the result list and get the top numbers to the top.
>>>
>>> format-number(max(count(/*/*[contains(@class, ' topic/body
>>> ')]//table/tgroup/tbody/row) ), '00000')
>>>
>>> Cheers,
>>>
>>>
>>> E.
>>> ----
>>> Eliot Kimber, Owner
>>> Contrext, LLC
>>> http://contrext.com
>>>
>>>
>>>
>>>
>>> On 5/5/16, 1:26 PM, "Eliot Kimber" < on
>>> behalf of > wrote:
>>>
>>>> I want to use the XQuery against files feature to do some quick
>>>> analysis:
>>>> Find topics with large tables and report those files and only those
>>>> files.
>>>>
>>>> It's not obvious, and I didn't find it in the help, how to do this. My
>>>> hope would be that when the scope selected in the XPath/XQuery builder
>>>> is
>>>> "selected project resources" that those would be treated as a
>>>> collection
>>>> so I could do e.g.:
>>>>
>>>> For $doc in collection()
>>>>      Return {do stuff with the docs}
>>>>
>>>> Is this possible?
>>>>
>>>> The analysis I'm trying to do is to find the largest tables within the
>>>> set
>>>> of documents and then report those tables sorted by size. I can do
>>>> this as
>>>> an Xpath but the results are ordered by the order of the documents in
>>>> the
>>>> input doc so I have to scroll through a list of 1500 results to find
>>>> the
>>>> few that I'm interested in.
>>>>
>>>> Of course I could do this in a standalone Xquery but I was hoping there
>>>> was a quick way to do it in the Xquery builder.
>>>>
>>>> Thanks,
>>>>
>>>> Eliot
>>>>
>>>> ----
>>>> Eliot Kimber, Owner
>>>> Contrext, LLC
>>>> http://contrext.com
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> oXygen-user mailing list
>>>> 
>>>> https://www.oxygenxml.com/mailman/listinfo/oxygen-user
>>>>
>>>
>>>
>>> _______________________________________________
>>> oXygen-user mailing list
>>> 
>>> https://www.oxygenxml.com/mailman/listinfo/oxygen-user
>>>
>>
>
>


More information about the oXygen-user mailing list