Skip to content

Commit

Permalink
Fix mixed up delivery objects in multiple output
Browse files Browse the repository at this point in the history
Broken in the refactor.
  • Loading branch information
alanpaxton committed Aug 2, 2022
1 parent 5222760 commit eda76e4
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -393,18 +393,19 @@ private MapType invoke() throws XPathException, SaxonApiException {
}
}

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

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

final Sequence primaryValue = postProcess(outputKey, delivery.convert(), options.postProcess);
final Sequence primaryValue = postProcess(outputKey, primaryDelivery.convert(), options.postProcess);
outputMap.add(outputKey, primaryValue);

for (final Map.Entry<URI, Delivery> resultDocument : resultDocuments.entrySet()) {
final AnyURIValue key = new AnyURIValue(resultDocument.getKey());
final Sequence value = postProcess(key, delivery.convert(), options.postProcess);
final Delivery secondaryDelivery = resultDocument.getValue();
final Sequence value = postProcess(key, secondaryDelivery.convert(), options.postProcess);
outputMap.add(key, value);
}

Expand Down

0 comments on commit eda76e4

Please sign in to comment.