<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Dear list,<br>
<br>
Is there a way to copy complex xml structures as part of a metamorph
transformation?<br>
<br>
You can find my complete example in <a
class="moz-txt-link-freetext"
href="https://github.com/linked-swissbib/metafacture-runner/blob/master/examples/gh/xmltest">https://github.com/linked-swissbib/metafacture-runner/blob/master/examples/gh/xmltest</a><br>
<br>
input.xml contains structured xml-tags. The aim is to select a key /
value pair where the value is not only a single value as with<br>
<<span class="pl-ent">data</span> <span class="pl-e">source</span>=<span
class="pl-s1"><span class="pl-pds">"</span>structuredtag.structuredtag1.singletag.value<span
class="pl-pds">"</span></span> <span class="pl-e">name</span>=<span
class="pl-s1"><span class="pl-pds">"</span>newNameOfSingleValue<span
class="pl-pds">"</span></span>/><br>
in the outputfile but the complete structure<br>
<<span class="pl-ent">data</span> <span class="pl-e">source</span>=<span
class="pl-s1"><span class="pl-pds">"</span>structuredtag<span
class="pl-pds">"</span></span> <span class="pl-e">name</span>=<span
class="pl-s1"><span class="pl-pds">"</span>newNameOfStructure<span
class="pl-pds">"</span></span>/><br>
would create the key "<span class="pl-s1">newNameOfStructure" with
the "structured value" (an entity in Metamorph datamodel)<br>
<structuredtag1><br>
<singletag>value of single tag</singletag><br>
</structuredtag1><br>
<br>
Actually I get only the empty element </span><br>
<span class="pl-s1"><<span class="pl-ent">newNameOfStructure</span>
/><br>
<br>
<br>
<br>
Background for my question:<br>
As we (Christoph, Pascal) talked at swib about it, I would like to
use Metafacture for the document processing of our Search-Engine
(SOLR). Currently we are using XSLT transformations with
Java-Plugins for special tasks (Enrichment, de-duplication etc.)<br>
Beside single document fields we store most of the complete
marc-xml structure and the complete holdings-structure as part of
the search-document so we are able to use this information in our
presentation logic. In xslt this can be easily done with the
<xsl:copy-of> task <br>
Compare [1] [2] [3] as examples for such a transformation.<br>
<br>
With Metamorph for simplification (hopefully) I used the more
general </span>handle-generic-xml<span class="pl-s1">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</span><span class="pl-s1"> module and not the specialized </span>handle-marcxml
decoder.<br>
The nice Metamorph datamodel explanation by Christoph [4]<span
class="pl-s1"> (section: "Darstellung von XML im
Metamorph-Datenmodell") together with some debugging of the
framework code by myself helped me to get to this point but now I
have difficulties. In general I'm pretty sure it should be
possible (I guess the new structure should be a new entity) but I
don't see how it is really done with metamorph.<br>
Thanks for any hint!<br>
<br>
Günter<br>
<br>
<br>
[1]<a class="moz-txt-link-freetext"
href="https://github.com/swissbib/content2SearchDocs/blob/master/xslt/swissbib.solr.step1.xsl#L76">https://github.com/swissbib/content2SearchDocs/blob/master/xslt/swissbib.solr.step1.xsl#L76</a><br>
[2]<a class="moz-txt-link-freetext"
href="https://github.com/swissbib/content2SearchDocs/blob/master/xslt/swissbib.solr.vufind2.xsl#L2785">https://github.com/swissbib/content2SearchDocs/blob/master/xslt/swissbib.solr.vufind2.xsl#L2785</a><br>
[3]<a class="moz-txt-link-freetext" href="https://github.com/linked-swissbib/metafacture-runner/blob/master/examples/gh/xmltest/exampleSolrDocument.xml">https://github.com/linked-swissbib/metafacture-runner/blob/master/examples/gh/xmltest/exampleSolrDocument.xml</a><br>
[4]<a class="moz-txt-link-freetext"
href="http://b3e.net/metamorph-book/latest/datamodel.html">http://b3e.net/metamorph-book/latest/datamodel.html</a><br>
</span><br>
<br>
<pre class="moz-signature" cols="72">--
Universität Basel
Universitätsbibliothek
Günter Hipler
Projekt SwissBib
Schoenbeinstrasse 18-20
4056 Basel, Schweiz
Tel.: + 41 (0)61 267 31 12 Fax: ++41 61 267 3103
E-Mail <a class="moz-txt-link-abbreviated" href="mailto:guenter.hipler@unibas.ch">guenter.hipler@unibas.ch</a>
URL: <a class="moz-txt-link-abbreviated" href="http://www.swissbib.org">www.swissbib.org</a> / <a class="moz-txt-link-freetext" href="http://www.ub.unibas.ch/">http://www.ub.unibas.ch/</a> </pre>
</body>
</html>