Page 1 of 1

distinct-values on project folder

Posted: Tue Jan 30, 2018 3:28 pm
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

Re: distinct-values on project folder

Posted: Tue Jan 30, 2018 4:27 pm
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