distinct-values on project folder

Having trouble installing Oxygen? Got a bug to report? Post it all here.
bwbohl
Posts: 37
Joined: Mon Jan 23, 2017 11:20 am

distinct-values on project folder

Post by bwbohl »

Hi oXygen team,

I was trying to get distinct values from all xml files in a specific project folder by using Path/XQuery Builder. It's set to Path 2.0 Scope is set to selected project resources. The folder is selected.

My Path is

Code: Select all


distinct-values(//settlement/text())
the result list though returns this XPath applied to each document. So I still get duplicate entries, i.e. one for each file containing a specific value. Is this intentional? Are there any settings I can change to prevent this behaviour?

Many thanks,
Benjamin
=====
oXygen XML Editor v24.1
macOS Monterey 12.3.1 Apple Silicon
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: distinct-values on project folder

Post by adrian »

Hi,

Unfortunately the scope does not behave as an XML collection(). XPath is simply applied on each file from the scope. I've logged an improvement request on our issue tracking tool to accommodate the need for a collection.
Meanwhile, you can use something like this:

Code: Select all

distinct-values(collection('file:/path/to/my/folder?select=*.xml')//settlement/text())
Scope doesn't matter for this one, so it should be applied on just a file (does not matter which).

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply