Skip to content

LabelledEntriesXSLT

Christian Lück edited this page Jul 25, 2022 · 1 revision

de.wwu.scdh.teilsp.extensions.LabelledEntriesXSLT

The plugin de.wwu.scdh.teilsp.extensions.LabelledEntriesXSLT is used to generate completion suggestions via XSLT.

Arguments

script

Required: The path to the XSLT script. This must be a valid URL. Use the right editor variables to get such an URL, e.g. ${pdu}/resources/xsl/witnesses.xsl to point to resources/xql/witnesses.xsl relative to your project directory URL.

parameters

Optional: Arbitrary external variables passed to your Xslt script. This has the form

VARIABLE1_NAME=VALUE1,VARIABLE2_NAME=VALUE2

templateLName

Optional: The local name of the XSLT template to call.

templatePrefix

Optional: The prefix of the Xslt template to call.

templateNamespace

Optioal: The namespace of the template to call.

Requirements for the Xslt script

  • The plugin calls a template with the arity 0 (no arguments).

  • By default it is obt:generate-entries(), where the prefix obt is bound to http://scdh.wwu.de/oxbytei.

  • The name of this template can be choosen by plugin arguments.

  • The template 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 named label for the key and label of the labelled entries.

  • See witnesses.xsl to get an idea.

Sample configuration

        <plugin>
            <class>de.wwu.scdh.teilsp.extensions.LabelledEntriesXSLT</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="script">${pdu}/resources/xsl/witnesses.xsl</argument>
                        <argument name="parameters">witness-catalog=${pdu}/WitnessCatalogue.xml</argument>
                    </arguments>
                </configuration>
            </configurations>
        </plugin>