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