<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLVorformatiertZchn
        {mso-style-name:"HTML Vorformatiert Zchn";
        mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert";
        font-family:"Consolas","serif";
        color:black;}
span.E-MailFormatvorlage19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Hi Günter,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">the extensibility of Metamorph is a bit limited as it is currently not possible to extend the schema. As a workaround you could use the java-function
 which allows you to use any Java class that implements the Function interface as a function. It would look like this in Metamoprh:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&lt;data source=”blabla”&gt;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&nbsp;&nbsp; &lt;java class=”fully.qualified.classname.to.FunctionClass” aParameter=”ABC” anotherParameter=”def” /&gt;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&lt;/data&gt;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">The attributes are mapped to setters of the same name. This works exactly like a function defined in the schema except that it looks ugly with
 the fully qualified java class name in the attribute </span><span lang="EN-GB" style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">J</span><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">It would be really cool to be able to add new functionality to Metamorph properly by extending the schema. I think it should not be too complicated.
 There are just two problems that need to be solved:<br>
1. The schema need to be adapted so that can be extended. I reckon that best way to do this is with a substitution group for the functions (and optionally the collectors). New elements can be added to these groups in derived schemas (I have not looked into
 this in detail, so there might be some caveats). I found the book “XML Schema” by Eric van der Vlist quite helpful when working with XML Schema in the past.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">2. Metamorph need to be made aware of the derived schema (in fact of the derived schemata as there might be more than one extension package). I
 have yet not thought about this point. There might be a way with Java XML use more than one schema for validation. However, a quick search seems to not confirm this, as the first hit on Google suggest to automatically generate a parent schema which includes
 the other ones see [1].<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">If you are interested in making the Metamorph schema extensible, that would be great!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Christoph<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">[1]
<a href="https://stackoverflow.com/questions/1094893/validate-an-xml-file-against-multiple-schema-definitions">
https://stackoverflow.com/questions/1094893/validate-an-xml-file-against-multiple-schema-definitions</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-GB" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">Von:</span></b><span lang="EN-GB" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext"> metafacture-bounces@lists.dnb.de
 [mailto:metafacture-bounces@lists.dnb.de] <b>Im Auftrag von </b>Günter Hipler<br>
<b>Gesendet:</b> Montag, </span><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">23. März 2015 23:43<br>
<b>An:</b> metafacture@lists.dnb.de<br>
<b>Cc:</b> Sebastian Schüpbach<br>
<b>Betreff:</b> [Metafacture] implementation of new morph functions<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Hi,<br>
<br>
I want to implement additional morph functions in my own repository and deploy them AS packaged jar-files<br>
<br>
There is a nice procedure with flux commands which are loaded as plugins when they are part of the plugins directory in the metafacture-runner repository. The only thing to be done is to write&nbsp; an additional flux-commands.properties file with the new commands.<br>
<br>
<br>
<br>
Metamorph functions in contrast have to be defined in the metamorph.xsd schema (&nbsp;&nbsp;&nbsp; &lt;group name=&quot;function&quot;&gt;) part of the metafacture-core repository.<br>
An additional morph-functions.properties file isn't enough. I get errors like:<br>
<br>
Exception in thread &quot;main&quot; org.culturegraph.mf.exceptions.MetafactureException: class org.culturegraph.mf.morph.Metamorph could not be instantiated<br>
&lt;snip....&gt;<br>
Caused by: org.culturegraph.mf.exceptions.MorphDefException: Error during DOM creation: Error parsing xml: cvc-complex-type.2.4.a: Invalid content was found starting with element 'itemLink'. One of '{<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:compose,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:regexp,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:replace,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:substring,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:lookup,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:whitelist,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:blacklist,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:isbn,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:equals,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:not-equals,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:case,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:timestamp,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:dateformat,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:htmlanchor,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:trim,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:split,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:normalize-utf8,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:occurrence,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:constant,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:count,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:urlencode,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:buffer,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:name,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:switch-name-value,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:unique,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:script,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:setreplace,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:java}' is expected.<br>
&nbsp;&nbsp;&nbsp; at org.culturegraph.mf.util.xml.DomLoader$TransformerErrorHandler.handle(DomLoader.java:215)<br>
&nbsp;&nbsp;&nbsp; at org.culturegraph.mf.util.xml.DomLoader$TransformerErrorHandler.error(DomLoader.java:205)<br>
&nbsp;&nbsp;&nbsp; at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.postErrorToListener(TransformerImpl.java:811)<br>
&nbsp;&nbsp;&nbsp; at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:754)<br>
&nbsp;&nbsp;&nbsp; at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:359)<br>
&nbsp;&nbsp;&nbsp; at org.culturegraph.mf.util.xml.DomLoader.parse(DomLoader.java:113)<br>
&nbsp;&nbsp;&nbsp; at org.culturegraph.mf.morph.AbstractMetamorphDomWalker.walk(AbstractMetamorphDomWalker.java:109)<br>
&nbsp;&nbsp;&nbsp; at org.culturegraph.mf.morph.AbstractMetamorphDomWalker.walk(AbstractMetamorphDomWalker.java:105)<br>
&nbsp;&nbsp;&nbsp; at org.culturegraph.mf.morph.Metamorph.&lt;init&gt;(Metamorph.java:163)<br>
&nbsp;&nbsp;&nbsp; at org.culturegraph.mf.morph.Metamorph.&lt;init&gt;(Metamorph.java:108)<br>
&nbsp;&nbsp;&nbsp; at org.culturegraph.mf.morph.Metamorph.&lt;init&gt;(Metamorph.java:98)<br>
&nbsp;&nbsp;&nbsp; at org.culturegraph.mf.morph.Metamorph.&lt;init&gt;(Metamorph.java:94)<br>
&nbsp;&nbsp;&nbsp; ... 15 more<br>
Caused by: javax.xml.transform.TransformerException: Error parsing xml: cvc-complex-type.2.4.a: Invalid content was found starting with element 'itemLink'. One of '{<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:compose,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:regexp,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:replace,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:substring,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:lookup,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:whitelist,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:blacklist,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:isbn,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:equals,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:not-equals,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:case,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:timestamp,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:dateformat,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:htmlanchor,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:trim,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:split,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:normalize-utf8,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:occurrence,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:constant,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:count,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:urlencode,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:buffer,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:name,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:switch-name-value,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:unique,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:script,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:setreplace,
<a href="http://www.culturegraph.org/metamorph">&quot;http://www.culturegraph.org/metamorph&quot;</a>:java}' is expected.<br>
&nbsp;&nbsp;&nbsp; ... 25 more<br>
<br>
<br>
At the moment I can't see a possibility to extend the metamorph.xsd in my extensions without changing the original schema and compiling the metafacture-core by my own.<br>
<br>
Any suggestions?<br>
<br>
<br>
Günter<br>
<br>
<o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>UNIVERSITÄT BASEL<o:p></o:p></pre>
<pre>Universitätsbibliothek<o:p></o:p></pre>
<pre>Günter Hipler<o:p></o:p></pre>
<pre>Projekt swissbib<o:p></o:p></pre>
<pre>Schönbeinstrasse 18-20<o:p></o:p></pre>
<pre>4056 Basel, Schweiz<o:p></o:p></pre>
<pre>Tel.: &#43;41 61 267 31 12 <o:p></o:p></pre>
<pre>Fax: &#43;41 61 267 31 03<o:p></o:p></pre>
<pre>E-Mail <a href="mailto:guenter.hipler@unibas.ch">guenter.hipler@unibas.ch</a><o:p></o:p></pre>
<pre>URL <a href="http://www.swissbib.org">www.swissbib.org</a><o:p></o:p></pre>
</div>
</div>
</body>
</html>