Skip to content

Commit 22fef81

Browse files
committed
[bugfix] fn:transform refactor had multi doc bug
Broken in the refactor. The refactored code was fetching secondary result documents from the wrong delivery object, so the secondary results were non-existent. Fetch from the correct delivery object.
1 parent 563edbd commit 22fef81

File tree

1 file changed

+4
-3
lines changed
  • exist-core/src/main/java/org/exist/xquery/functions/fn/transform

1 file changed

+4
-3
lines changed

exist-core/src/main/java/org/exist/xquery/functions/fn/transform/Transform.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,18 +393,19 @@ private MapType invoke() throws XPathException, SaxonApiException {
393393
}
394394
}
395395

396-
private MapType makeResultMap(final Options options, final Delivery delivery, final Map<URI, Delivery> resultDocuments) throws XPathException {
396+
private MapType makeResultMap(final Options options, final Delivery primaryDelivery, final Map<URI, Delivery> resultDocuments) throws XPathException {
397397

398398
final MapType outputMap = new MapType(context);
399399
final AtomicValue outputKey;
400400
outputKey = options.baseOutputURI.orElseGet(() -> new StringValue("output"));
401401

402-
final Sequence primaryValue = postProcess(outputKey, delivery.convert(), options.postProcess);
402+
final Sequence primaryValue = postProcess(outputKey, primaryDelivery.convert(), options.postProcess);
403403
outputMap.add(outputKey, primaryValue);
404404

405405
for (final Map.Entry<URI, Delivery> resultDocument : resultDocuments.entrySet()) {
406406
final AnyURIValue key = new AnyURIValue(resultDocument.getKey());
407-
final Sequence value = postProcess(key, delivery.convert(), options.postProcess);
407+
final Delivery secondaryDelivery = resultDocument.getValue();
408+
final Sequence value = postProcess(key, secondaryDelivery.convert(), options.postProcess);
408409
outputMap.add(key, value);
409410
}
410411

0 commit comments

Comments
 (0)