Allow elementset to be configured
[mp-xquery-moved-to-github.git] / doc / xquery.xml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
2     "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3 ]>
4 <refentry id="xquery">
5  <refentryinfo>
6   <productname>Metaproxy XQuery module</productname>
7   <info><orgname>Index Data</orgname></info>
8  </refentryinfo>
9
10  <refmeta>
11   <refentrytitle>xquery</refentrytitle>
12   <manvolnum>3mp</manvolnum>
13   <refmiscinfo class="manual">Metaproxy Module</refmiscinfo>
14  </refmeta>
15
16  <refnamediv>
17   <refname>xquery</refname>
18   <refpurpose>
19    Metaproxy Module for performing record transform using XQuery
20   </refpurpose>
21  </refnamediv>
22
23  <refsect1><title>DESCRIPTION</title>
24   <para>
25    This filter performs record transforms on XML records using
26    XQuery. The module is based on Zorba.
27   </para>
28   <para>
29    Configurable values:
30    <variablelist>
31     <varlistentry><term>&lt;elementset name="name1" backend="name2"/&gt;</term>
32      <listitem>
33       <para>
34        Specifies the elementset (name1) that triggers the transform.
35        Note that the record syntax must be XML as well.
36        The 2nd element set, name2, specifies the element set that
37        is sent to the next filter in chain (backend).
38       </para>
39      </listitem>
40     </varlistentry>
41     <varlistentry><term>&lt;script name="name"/&gt;</term>
42      <listitem>
43       <para>
44        The full path of the XQuery script to be invoked.
45        This is required and should be set exactly once.
46       </para>
47      </listitem>
48     </varlistentry>
49     <varlistentry><term>&lt;record name="var"/&gt;</term>
50      <listitem>
51       <para>
52        The name of the XQUery variable where the input XML record
53        is stored.
54        This is required and should be set exactly once.
55       </para>
56      </listitem>
57     </varlistentry>
58     <varlistentry><term>&lt;variable name="name" value="value"/&gt;</term>
59      <listitem>
60       <para>
61        Sets XQuery variable name to value. This is set before each
62        record is converted. This setting may be repeated to set multiple
63        variables.
64       </para>
65      </listitem>
66     </varlistentry>
67    </variablelist>
68   </para>
69  </refsect1>
70
71  <refsect1><title>SCHEMA</title>
72    <literallayout><xi:include
73                      xi:href="filter_xquery.rnc"
74                      xi:parse="text"
75                      xmlns:xi="http://www.w3.org/2001/XInclude" />
76    </literallayout>
77  </refsect1>
78
79  <refsect1><title>EXAMPLES</title>
80   <para>
81    Configuration for converting MARCXML to BIBFRAME.
82    <screen><![CDATA[
83     <filter type="xquery">
84       <elementset name="bibframe" backend="marcxml"/>
85       <script name="/usr/share/marc2bibframe/xbin/zorba3-0.xqy"/>
86       <record name="marcxmluri"/>
87       <variable name="serialization" value="rdxml"/>
88       <variable name="baseuri" value="http://base/"/>
89     </filter>
90 ]]>
91    </screen>
92   </para>
93  </refsect1>
94
95  <refsect1><title>SEE ALSO</title>
96   <para>
97    <citerefentry>
98     <refentrytitle>metaproxy</refentrytitle>
99     <manvolnum>1</manvolnum>
100    </citerefentry>
101   </para>
102  </refsect1>
103
104 </refentry>
105
106 <!-- Keep this comment at the end of the file
107 Local variables:
108 mode: nxml
109 nxml-child-indent: 1
110 End:
111 -->