Happy new year
[metaproxy-moved-to-github.git] / doc / record_transform.xml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN" 
2     "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3  <!ENTITY copyright SYSTEM "copyright.xml">
4  <!ENTITY % idcommon SYSTEM "common/common.ent">
5      %idcommon;
6 ]>
7 <refentry id="ref-record_transform">
8  <refentryinfo>
9   <productname>Metaproxy</productname>
10   <info><orgname>Index Data</orgname></info>
11  </refentryinfo>
12
13  <refmeta>
14   <refentrytitle>record_transform</refentrytitle>
15   <manvolnum>3mp</manvolnum>
16   <refmiscinfo class="manual">Metaproxy Module</refmiscinfo>
17  </refmeta>
18  
19  <refnamediv>
20   <refname>record_transform</refname>
21   <refpurpose>Metaproxy Module that performs Z39.50 presentResponse record transformations</refpurpose>
22  </refnamediv>
23
24  <refsect1><title>DESCRIPTION</title>
25   <para>
26    This filter acts only on Z3950 present requests, and let all
27    other types of packages and requests pass untouched. It's use is
28    twofold: blocking Z3950  present requests, which the backend
29    server does not understand and can not honor, and transforming
30    the present syntax and elementset name according to the rules
31    specified, to fetch only existing record formats, and transform
32    them on the fly to requested record syntaxes.
33   </para> 
34   <para>
35    The allowed record present syntax and 
36    element name are described in multiple
37    <literal>&lt;retrieval&gt;</literal> elements inside the 
38    <literal>&lt;retrievalinfo&gt;</literal>
39    element. The <literal>syntax</literal> attribute is mandatory, but
40    the <literal>name</literal> attribute
41    may be omitted, in which case any 
42    element name is accepted. An additional
43    <literal>identifier</literal> attribute can be added to explicitly
44    describe the Z3950 identifier string.
45   </para>
46   <para>
47   Record transformations are invoked when the optional attributes
48   <literal>backendsyntax</literal> and <literal>backendname</literal>
49   as well as the <literal>&lt;convert&gt;</literal> element are specified.  
50   Record conversions come in two flavors:
51   <literal>&lt;marc&gt;</literal> binary conversions between different
52   binary MARC formats and MarcXML formats, and
53   <literal>&lt;xslt&gt;</literal> stylesheet transformations performed
54   on any kind of XML records. These conversions can be stacked in any
55   order, and are performed linearly in file order. 
56   </para>
57   <para>
58    The binary MARC record transformations
59  <literal>&lt;marc&gt;</literal> are defined using the following
60    attributes: <literal>inputformat</literal>, <literal>outputformat</literal>,
61    <literal>inputcharset</literal> and  <literal>outputcharset</literal>.
62   </para>
63   <para>
64    XML <literal>&lt;xslt&gt;</literal> transformation instructions
65    accept only one mandatory <literal>stylesheet</literal> attribute,
66    which is either an absolute path, or a relative path from the
67    working directory of <literal>metaproxy</literal> to the location
68    of the requested XSLT stylesheet.
69   </para>
70  </refsect1>
71  
72  <refsect1><title>EXAMPLES</title>
73   <para>
74    A typical configuration looks like this:
75    <screen><![CDATA[
76    <filter type="record_transform">
77      <retrievalinfo>
78         <retrieval syntax="grs-1"/>
79         <retrieval syntax="usmarc" name="F"/>
80         <retrieval syntax="usmarc" name="B"/>
81         <retrieval syntax="xml" name="marcxml"
82                    identifier="info:srw/schema/1/marcxml-v1.1"
83                    backendsyntax="usmarc" backendname="F">
84           <convert>
85             <marc inputformat="marc" outputformat="marcxml"
86                   inputcharset="marc-8"/>
87           </convert>
88         </retrieval>
89         <retrieval syntax="xml" name="danmarc"
90                    backendsyntax="usmarc" backendname="F">
91           <convert>
92             <marc inputformat="marc" outputformat="marcxchange"
93                   inputcharset="marc-8"/>
94           </convert>
95         </retrieval>
96         <retrieval syntax="xml" name="dc"
97                    identifier="info:srw/schema/1/dc-v1.1"
98                    backendsyntax="usmarc" backendname="F">
99           <convert>
100             <marc inputformat="marc" outputformat="marcxml"
101                   inputcharset="marc-8"/>
102             <xslt stylesheet="xml/xslt/MARC21slim2DC.xsl"/>
103           </convert>
104         </retrieval>
105       </retrievalinfo>
106    </filter>
107 ]]>
108    </screen>
109   </para>
110  </refsect1> 
111  
112  <refsect1><title>SEE ALSO</title>
113   <para>
114    <citerefentry>
115     <refentrytitle>metaproxy</refentrytitle>
116     <manvolnum>1</manvolnum>
117    </citerefentry>
118   </para>
119  </refsect1>
120  
121  &copyright;
122 </refentry>
123
124 <!-- Keep this comment at the end of the file
125 Local variables:
126 mode: sgml
127 sgml-omittag:t
128 sgml-shorttag:t
129 sgml-minimize-attributes:nil
130 sgml-always-quote-attributes:t
131 sgml-indent-step:1
132 sgml-indent-data:t
133 sgml-parent-document:nil
134 sgml-local-catalogs: nil
135 sgml-namecase-general:t
136 End:
137 -->