Skip to content

Commit 2792625

Browse files
committed
handle document {} vs element
1 parent 61f8b98 commit 2792625

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

marklogic-data-hub/src/main/resources/ml-modules/root/com.marklogic.hub/lib/flow-lib.xqy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,10 @@ declare function flow:run-flow(
547547
: @param $map - a map with all the stuff in it
548548
: @return - the newly constructed envelope
549549
:)
550-
declare function flow:make-envelope($map as map:map, $data-format as xs:string)
550+
declare function flow:make-envelope(
551+
$map as map:map,
552+
$data-format as xs:string)
553+
as document-node()
551554
{
552555
if ($data-format eq $JSON) then
553556
let $headers := fn:head((map:get($map, "headers"), json:array()))

marklogic-data-hub/src/main/resources/ml-modules/root/com.marklogic.hub/mlcp-flow-transform.xqy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ declare function mlcpFlow:transform(
5252
if (trace:enabled()) then
5353
trace:plugin-trace(
5454
$uri,
55-
if ($envelope instance of element()) then ()
55+
if ($envelope/node() instance of element()) then ()
5656
else
5757
null-node {},
5858
"writer",
5959
$flow/hub:type,
6060
$envelope,
61-
if ($envelope instance of element()) then ()
61+
if ($envelope/node() instance of element()) then ()
6262
else
6363
null-node {},
6464
xs:dayTimeDuration("PT0S")

0 commit comments

Comments
 (0)