Skip to content

Commit 2d900fe

Browse files
Rob TjalmaRob Tjalma
authored andcommitted
Fixed listing after name change
Signed-off-by: Rob Tjalma <[email protected]>
1 parent cdb09e3 commit 2d900fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@ public List<Item> list(SclType type) {
8383
format(DECLARE_DB_VARIABLE, type) +
8484
"for $resource in db:open($db)\n" +
8585
" let $id := $resource/scl:SCL/scl:Header/@id\n" +
86-
" let $name := $resource/scl:SCL/scl:Private[@type='" + COMPAS_SCL_EXTENSION_TYPE + "']/compas:" + SCL_NAME_EXTENSION.getFieldName() + "\n" +
8786
" group by $id\n" +
88-
" return '<Item><Id>' || $id || '</Id><Name>' || $name || '</Name><Version>' || local:latest-version($db, $id)//scl:SCL/scl:Header/@version || '</Version></Item>'",
87+
" let $latestScl := local:latest-version($db, $id)\n" +
88+
" let $version := $latestScl//scl:SCL/scl:Header/@version\n" +
89+
" let $name := $latestScl//scl:SCL/scl:Private[@type='" + COMPAS_SCL_EXTENSION_TYPE + "']/compas:" + SCL_NAME_EXTENSION.getFieldName() + "\n" +
90+
" return '<Item><Id>' || $id || '</Id><Name>' || $name || '</Name><Version>' || $version || '</Version></Item>'",
8991
sclDataMarshaller::unmarshal
9092
);
9193
}

0 commit comments

Comments
 (0)