Closed bsrikan closed 7 years ago
I'm in this code right now fixing issue #349 so I'll try to get it snuck in at this late stage. Not good to ship a syntax error.
I see now why I hit this error. the partial function is not composable with the es:with-namespace expression in the way I would have expected. interesting. I need to look more closely at your expected value though...
Ok. I mentioned it so, since that version worked for me. But you are right, please check for other scenarios too.
This particular property is hitting the 'reference from scalar' logic. The expected value needs to be its own function, which could go in a variable or inline. Here's the inline version:
let $hasCustomerID := $source-node/hasCustomerID ! function($src-node) {
es:init-instance($src-node, 'Customer')
=>es:with-namespace('http://y','y')}(.)
Test in e2e verified this bug and is working as expected. Shipping.
For a property say "hasCustomerID" that is an internal ref in model2, version translator produces a syntax error on deploying the artifact.
Model1:
Model2:
Code in version translator that produces syntax err:
expected:
let $hasCustomerID := $source-node/hasCustomerID ! $extract-reference-Customer(.)