Skip to content

Commit ea35a84

Browse files
author
Dennis Labordus
committed
Small changes to test retrieval unique labels.
Signed-off-by: Dennis Labordus <[email protected]>
1 parent 33a153f commit ea35a84

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

app/src/test/java/org/lfenergy/compas/scl/data/rest/CompasSclDataServiceConfigurationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ void createElementConverter_WhenCalled_ThenObjectReturned() {
1717
void createSclDataModelMarshaller_WhenCalled_ThenObjectReturned() {
1818
assertNotNull(new CompasSclDataServiceConfiguration().createSclDataModelMarshaller());
1919
}
20-
}
20+
}

repository-basex/src/main/java/org/lfenergy/compas/scl/data/basex/repository/CompasSclDataBaseXRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public class CompasSclDataBaseXRepository implements CompasSclDataRepository {
7878
// Retrieve the Labels as XML Label elements from the XML. The result can be returned by the List functions.
7979
private static final String DECLARE_LABELS_FUNC = """
8080
declare function local:createLabelsResponse($latestScl as document-node()) as xs:string* {
81-
let $labels := $latestScl/scl:SCL/scl:Private[@type=$compasSclExtensionType]/compas:Labels/compas:Label
81+
let $labels := distinct-values($latestScl/scl:SCL/scl:Private[@type=$compasSclExtensionType]/compas:Labels/compas:Label)
8282
for $label in $labels
8383
return ' <Label>' || $label || '</Label>'
8484
};

repository/src/test/resources/scl/scl_compas.scd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
<compas:Labels>
1010
<compas:Label>Label-1</compas:Label>
1111
<compas:Label>Label-2</compas:Label>
12+
<compas:Label>Label-2</compas:Label>
13+
<compas:Label>Label-2</compas:Label>
1214
</compas:Labels>
1315
</Private>
1416
<Header id="HeaderID" version="version" revision="Revision" toolID="toolID" nameStructure="IEDName">

0 commit comments

Comments
 (0)