Database Reference
In-Depth Information
<parameter
name=
"elements"
>
<rename
from=
"d"
to=
"e"
/>
<rename
from=
"e"
to=
"d"
/>
</parameter>
</trigger>
</triggers>
</collection>
To test the example:
1. Store the following document into
/db/test-data
:
<a>
<b>
<c>
should be removed
</c>
<c>
should also be removed
</c>
</b>
<c>
should not be removed
</c>
<d>
should be renamed to e
</d>
<e>
should be renamed to d
</e>
</a>
2. Open the actual document stored into
/db/test-data
. You should see that it
instead contains something like the following:
<a>
<b/>
<c>
should not be removed
</c>
<e>
should be renamed to e
</e>
<d>
should be renamed to d
</d>
</a>
Internal XQuery Library Modules
As you know by now, XQuery modules come in two varieties,
main modules
and
library modules
. Main modules can be directly invoked, and execution begins at the
query body
. Main modules may import other library modules, but a complete
XQuery may contain only a single main module. Library modules reside in a specific
namespace and contain function and variable declarations grouped by that name‐
space. Library modules do not have a query body, and thus there is no way to directly
execute a library module, but frameworks like RESTXQ (see
“Building Applications
with RESTXQ” on page 215
) and eXist's SOAP Server (see
“SOAP Server” on page
362
) are able to map HTTP requests onto specific library module function invoca‐
tions.
eXist provides two types of library modules:
Search WWH ::
Custom Search