Yes it is somewhat equivalent.
<commands>
<create-db name="en-us"/>
<add path="devicehelp.xml">
<menu id="devicehelp"/>
</add>
<add path="smbonly.xml">
<menu id="smbonly"/>
</add>
<add path="ptt-help.xml">
<menu id="ptt-help"/>
</add>
<xquery><![CDATA[
db:replace('en-us', 'devicehelp.xml', <menu id="new"/>)
]]></xquery>
<list name="en-us"/>
</commands>
for $x in /*
return $x/data(@id)
gets me: devicehelp smbonly ptt-help
Baril,
sorry, but I’m still not sure how to reproduce your use case.
Is app:open-db(...) equivalent to db:open(...) ?
> let $raw-menu := app:open-db('en-us')/menu[@id = $menu-id]
Do you think that the following script is equivalent to what you do via RESTXQ?
<commands>
<create-db name='en-us'/>
<add path='devicehelp.xml'><menu id="devicehelp"/></add>
<add path='smbonly.xml'><menu id="smbonly"/></add>
<add path='ptt-help.xml'><menu id="ptt-help"/></add>
<xquery><![CDATA[
db:replace('en-us', 'devicehelp.xml', <menu id="devicehelp"/>)
]]></xquery>
<list name='en-us'/>
</commands>
You can save this script using the ".bxs" suffix, and open and run it
via the GUI or on command-line (basex script.bxs).
Christian