[Metafacture] copy / use of complex xml structures with Metamorph

Guenter Hipler guenter.hipler at unibas.ch
Mon Jan 12 22:22:10 CET 2015


Dear list,

Is there a way to copy complex xml structures as part of a metamorph 
transformation?

You can find my complete example in 
https://github.com/linked-swissbib/metafacture-runner/blob/master/examples/gh/xmltest

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
<data source="structuredtag.structuredtag1.singletag.value" 
name="newNameOfSingleValue"/>
in the outputfile  but the complete structure
<data source="structuredtag" name="newNameOfStructure"/>
would create the key "newNameOfStructure" with the "structured value" 
(an entity in Metamorph datamodel)
<structuredtag1>
<singletag>value of single tag</singletag>
</structuredtag1>

Actually I get only the empty element
<newNameOfStructure />



Background for my question:
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.)
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
Compare [1] [2] [3] as examples for such a transformation.

With Metamorph for simplification (hopefully) I used the more general 
handle-generic-xmlmodule and not the specialized handle-marcxml decoder.
The nice Metamorph datamodel explanation by Christoph [4](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.
Thanks for any hint!

Günter


[1]https://github.com/swissbib/content2SearchDocs/blob/master/xslt/swissbib.solr.step1.xsl#L76
[2]https://github.com/swissbib/content2SearchDocs/blob/master/xslt/swissbib.solr.vufind2.xsl#L2785
[3]https://github.com/linked-swissbib/metafacture-runner/blob/master/examples/gh/xmltest/exampleSolrDocument.xml
[4]http://b3e.net/metamorph-book/latest/datamodel.html


-- 
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-Mailguenter.hipler at unibas.ch
URL:www.swissbib.org   /http://www.ub.unibas.ch/  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.dnb.de/pipermail/metafacture/attachments/20150112/01671ab9/attachment.html


More information about the Metafacture mailing list