Skip to content

Commit 984f39b

Browse files
rolonPabloMarkLogic Builder
authored andcommitted
DHFPROD-7512: 5.5 Matching - Bad error when Cant match JSON when namespace defined in model
1 parent 3ec58c4 commit 984f39b

File tree

1 file changed

+8
-1
lines changed
  • marklogic-data-hub/src/main/resources/ml-modules/root/com.marklogic.smart-mastering/impl

1 file changed

+8
-1
lines changed

marklogic-data-hub/src/main/resources/ml-modules/root/com.marklogic.smart-mastering/impl/util.xqy

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,14 @@ declare function util-impl:properties-to-values-functions(
153153
let $qname := fn:QName(fn:string($namespace), fn:string($property-title))
154154
return
155155
function($document) {
156-
$document/(es:envelope|envelope)/(es:instance|instance)/*/*[fn:node-name(.) eq $qname]
156+
let $is-json := (xdmp:node-kind($document) = "object" or fn:exists($document/(object-node()|array-node())))
157+
let $qname:=
158+
if($is-json)
159+
then
160+
fn:QName("", fn:string($property-title))
161+
else
162+
$qname
163+
return $document/(es:envelope|envelope)/(es:instance|instance)/*/*[fn:node-name(.) eq $qname]
157164
}
158165
else if (fn:exists($document-xpath-rule)) then
159166
let $xpath := fn:head(($document-xpath-rule/(@path|path),$property-name))

0 commit comments

Comments
 (0)