Skip to content

Commit 6a868d6

Browse files
author
Dennis Labordus
committed
Select the first Hitem that matches the version.
Signed-off-by: Dennis Labordus <[email protected]>
1 parent c73de5c commit 6a868d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

repository-postgresql/src/main/java/org/lfenergy/compas/scl/data/repository/postgresql/CompasSclDataPostgreSQLRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class CompasSclDataPostgreSQLRepository implements CompasSclDataRepositor
3333
private static final String JOIN_HEADER_CLAUSE = " left outer join (" +
3434
"SELECT id, major_version, minor_version, patch_version," +
3535
" unnest(" +
36-
" xpath('/scl:SCL/scl:Header//scl:Hitem[(not(@revision) or @revision=\"\") and @version=\"' || major_version || '.' || minor_version || '.' || patch_version || '\"]' " +
36+
" xpath('(/scl:SCL/scl:Header//scl:Hitem[(not(@revision) or @revision=\"\") and @version=\"' || major_version || '.' || minor_version || '.' || patch_version || '\"])[1]' " +
3737
" , scl_data::xml " +
3838
" , ARRAY[ARRAY['scl', 'http://www.iec.ch/61850/2003/SCL']])) as header " +
3939
" from scl_file) scl_data " +

0 commit comments

Comments
 (0)