Next in thread → Next in month →

Re: [xml-dev] Converting schema to schematron

From
Ghislain Fourny <>
To
Michael Kay <>
Date
2017-08-14T08:53:16Z
ID
<>
Thread
Re: [xml-dev] Converting schema to schematron
Hi Mike,

> Once you have this basic support at the data structure level, you probably need to introduce operations that take advantage of it: rather like map:put which creates a new map as a modified copy of an existing map, with a delta implementation underneath, you need operations that create a new tree which is a delta copy of an existing tree differing only in small details, e.g. a change in the value of a single attribute.

Syntactically, this would be very similar to a copy-modify-return with an update expression. This functionality is actually supported by JSONiq with a syntax similar to the Update Facility -- but on JSON trees (where there are no parent pointers in the JDM design).

With Zorba 3.0:
__
jsoniq version "1.0";

let $a := {
  "foo" : 1,
  "bar" : [
    { "foobar" : 2 },
    { "foobar" : 5 }
  ]
}
return
 copy $b := $a
 modify replace value of json $b.bar[[1]].foobar with 3
 return $b
__

Kind regards,
Ghislain
Next in thread → Next in month →