-
Notifications
You must be signed in to change notification settings - Fork 0
LabelledEntriesXQuery
The plugin
de.wwu.scdh.teilsp.extensions.LabelledEntriesXQuery
is
used to generate completion suggestions via XQuery.
Required: The path to the XQuery script. This must be a valid URL. Use
the right editor variables to get such an URL,
e.g. ${pdu}/resources/xql/witnesses.xql
to point to
resources/xql/witnesses.xql
relative to your project directory URL.
Optional: Arbitrary external variables passed to your XQuery script. This has the form
VARIABLE1_NAME=VALUE1,VARIABLE2_NAME=VALUE2
Optional: The local name of the XQuery function to call.
Optional: The prefix of the XQuery function to call.
Optioal: The namespace of the function to call.
-
The plugin calls a function with the arity 0 (no arguments).
-
By default it is
obt:generate-entries()
, where the prefixobt
is bound tohttp://scdh.wwu.de/oxbytei
. -
The name of this function can be choosen by plugin arguments.
-
The function must return
map(xs:string, xs:string)*
, i.e. a sequence of maps, where keys and values are strings. Cf. Saxonica's documentation of maps. -
There should (must) be a key named
key
and a key namedlabel
for the key and label of the labelled entries. -
See witnesses.xql to get an idea.
<plugin>
<class>de.wwu.scdh.teilsp.extensions.LabelledEntriesXQuery</class>
<type>de.wwu.scdh.teilsp.services.extensions.ILabelledEntriesProvider</type>
<configurations>
<configuration>
<conditions>
<condition domain="context">self::*:lem | self::*:rdg</condition>
<condition domain="priority">10</condition>
<condition domain="nodeName">wit</condition>
<condition domain="nodeType">attributeValue</condition>
</conditions>
<arguments>
<argument name="xquery">${pdu}/resources/xql/witnesses.xql</argument>
<argument name="external">witness-catalog=${pdu}/WitnessCatalogue.xml</argument>
</arguments>
</configuration>
</configurations>
</plugin>