Commit 61ee2ad1 authored by Jens Kupferschmidt's avatar Jens Kupferschmidt
Browse files

version 2014.06.01

parent d16319f6
......@@ -22,6 +22,8 @@ package org.mycore.frontend;
import java.io.InputStream;
import java.net.URL;
import java.text.MessageFormat;
import java.util.Date;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
......@@ -43,10 +45,14 @@ import org.mycore.datamodel.common.MCRActiveLinkException;
import org.mycore.datamodel.metadata.MCRMetaElement;
import org.mycore.datamodel.metadata.MCRMetadataManager;
import org.mycore.datamodel.metadata.MCRObject;
import org.mycore.datamodel.metadata.MCRObjectID;
import org.mycore.datamodel.metadata.MCRObjectMetadata;
import org.mycore.datamodel.metadata.MCRObjectService;
import org.mycore.frontend.servlets.MCRServletJob;
import org.mycore.frontend.servlets.gnd.MCRGNDEntityByPublicIDServlet;
import org.mycore.services.fieldquery.MCRQuery;
import org.mycore.services.fieldquery.MCRQueryManager;
import org.mycore.services.fieldquery.MCRQueryParser;
import org.mycore.services.fieldquery.MCRResults;
/**
* This class contains all common methods to handle the authrity files of LCNAF and GND
......@@ -96,12 +102,12 @@ public class MCRVIAFAuthorityFileUtils {
}
public static final MCRObject getLCNAFAsMarc21XML(MCRServletJob job, String lcnaf) throws Exception {
Transformer trans = MCRVIAFAuthorityFileUtils.getTransformer(MCRVIAFAuthorityFileUtils.GND_TRANSFORMER);
Transformer trans = MCRVIAFAuthorityFileUtils.getTransformer(MCRVIAFAuthorityFileUtils.LCNAF_TRANSFORMER);
URL url = new URL("http://id.loc.gov/authorities/names/" + lcnaf + ".marcxml.xml");
Document doc = new SAXBuilder().build(url);
if (doc == null) {
if (job != null) {
job.getResponse().sendRedirect(job.getResponse().encodeRedirectURL(GND_IMPORT_ERROR_PAGE));
job.getResponse().sendRedirect(job.getResponse().encodeRedirectURL(LCNAF_IMPORT_ERROR_PAGE));
} else {
return null;
}
......@@ -145,7 +151,73 @@ public class MCRVIAFAuthorityFileUtils {
}
new_metadata.setMetadataElement(old_firstPlace);
}
// set old secondDate
MCRMetaElement old_secondDate = old_metadata.getMetadataElement("def.secondDate");
if (old_secondDate != null) {
MCRMetaElement new_secondDate = new_metadata.getMetadataElement("def.secondDate");
if (new_secondDate != null) {
new_metadata.removeMetadataElement("def.secondDate");
}
new_metadata.setMetadataElement(old_secondDate);
}
// set old secondPlace
MCRMetaElement old_secondPlace = old_metadata.getMetadataElement("def.secondPlace");
if (old_secondPlace != null) {
MCRMetaElement new_secondPlace = new_metadata.getMetadataElement("def.secondPlace");
if (new_secondPlace != null) {
new_metadata.removeMetadataElement("def.secondPlace");
}
new_metadata.setMetadataElement(old_secondPlace);
}
// set old profession
MCRMetaElement old_profession = old_metadata.getMetadataElement("def.profession");
if (old_profession != null) {
MCRMetaElement new_profession = new_metadata.getMetadataElement("def.profession");
if (new_profession != null) {
new_metadata.removeMetadataElement("def.profession");
}
new_metadata.setMetadataElement(old_profession);
}
// set old placeOfActivity
MCRMetaElement old_placeOfActivity = old_metadata.getMetadataElement("def.placeOfActivity");
if (old_placeOfActivity != null) {
MCRMetaElement new_placeOfActivity = new_metadata.getMetadataElement("def.placeOfActivity");
if (new_placeOfActivity != null) {
new_metadata.removeMetadataElement("def.placeOfActivity");
}
new_metadata.setMetadataElement(old_placeOfActivity);
}
// set old literarySource
MCRMetaElement old_literarySource = old_metadata.getMetadataElement("def.literarySource");
if (old_literarySource != null) {
MCRMetaElement new_literarySource = new_metadata.getMetadataElement("def.literarySource");
if (new_literarySource != null) {
new_metadata.removeMetadataElement("def.literarySource");
}
new_metadata.setMetadataElement(old_literarySource);
}
// set old note
MCRMetaElement old_note = old_metadata.getMetadataElement("def.note");
if (old_note != null) {
MCRMetaElement new_note = new_metadata.getMetadataElement("def.note");
if (new_note != null) {
new_metadata.removeMetadataElement("def.note");
}
new_metadata.setMetadataElement(old_note);
}
// set old link
MCRMetaElement old_link = old_metadata.getMetadataElement("def.link");
if (old_link != null) {
MCRMetaElement new_link = new_metadata.getMetadataElement("def.link");
if (new_link != null) {
new_metadata.removeMetadataElement("def.link");
}
new_metadata.setMetadataElement(old_link);
}
// createDate
MCRObjectService service = old_obj.getService();
Date date = service.getDate(MCRObjectService.DATE_TYPE_CREATEDATE);
new_obj.getService().setDate(MCRObjectService.DATE_TYPE_CREATEDATE, date);
try {
MCRMetadataManager.update(new_obj);
} catch (MCRPersistenceException e) {
......@@ -191,7 +263,7 @@ public class MCRVIAFAuthorityFileUtils {
TransformerFactory transfakt = TransformerFactory.newInstance();
transfakt.setURIResolver(MCRURIResolver.instance());
Transformer trans = transfakt.newTransformer(source);
LOGGER.debug("Transformer stylesheet " + xslfile + " is produces.");
LOGGER.debug("Transformer stylesheet " + xslfile + " is produced.");
return trans;
} else {
LOGGER.warn("Can't load transformer ressource " + xslfile + ".");
......@@ -199,4 +271,34 @@ public class MCRVIAFAuthorityFileUtils {
return null;
}
/**
* Checks whether a authority file with the given gnd exists or not
*
* @param gnd
* the GND number
* @return <code>true</code>, if the authority file exists, <code>false</code>
* otherwise
*/
public static final MCRResults existsGND(String gnd) {
String qString = MessageFormat.format("(objectType = \"viaf\") AND (viafidgnd = \"{1}\")", gnd);
MCRQuery query = new MCRQuery(new MCRQueryParser().parse(qString));
MCRResults results = MCRQueryManager.search(query);
return results;
}
/**
* Checks whether a person with the given gnd exists or not
*
* @param lcnaf
* the LoC number
* @return <code>true</code>, if the person exists, <code>false</code>
* otherwise
*/
public static final MCRResults existsLCNAF(String lcnaf) {
String qString = MessageFormat.format("(objectType = \"viaf\") AND (viafidlcnaf = \"{0}\")", lcnaf);
MCRQuery query = new MCRQuery(new MCRQueryParser().parse(qString));
MCRResults results = MCRQueryManager.search(query);
return results;
}
}
......@@ -20,24 +20,9 @@
package org.mycore.frontend.cli;
import java.io.InputStream;
import java.net.URL;
import java.text.MessageFormat;
import java.util.Iterator;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerFactoryConfigurationError;
import javax.xml.transform.stream.StreamSource;
import org.apache.log4j.Logger;
import org.jdom2.Document;
import org.jdom2.input.SAXBuilder;
import org.jdom2.transform.JDOMResult;
import org.jdom2.transform.JDOMSource;
import org.mycore.common.MCRUtils;
import org.mycore.common.xml.MCRURIResolver;
import org.mycore.access.MCRAccessManager;
import org.mycore.datamodel.metadata.MCRMetaElement;
import org.mycore.datamodel.metadata.MCRMetaLangText;
import org.mycore.datamodel.metadata.MCRMetadataManager;
......@@ -50,7 +35,6 @@ import org.mycore.services.fieldquery.MCRHit;
import org.mycore.services.fieldquery.MCRQuery;
import org.mycore.services.fieldquery.MCRQueryCondition;
import org.mycore.services.fieldquery.MCRQueryManager;
import org.mycore.services.fieldquery.MCRQueryParser;
import org.mycore.services.fieldquery.MCRResults;
/**
......@@ -62,71 +46,142 @@ import org.mycore.services.fieldquery.MCRResults;
@MCRCommandGroup(name = "MCR VIAF data format commands")
public class MCRVIAFCommands extends MCRAbstractCommands {
/** The logger */
private static Logger LOGGER = Logger.getLogger(MCRVIAFCommands.class.getName());
/**
* This method import the VIAF authority file entries from DNB for a given number
*/
@MCRCommand(syntax = "import gnd entry {0}", help = "Import an entry with number {0} from the DNB.", order = 10)
public final static void importEntryFromGND(String entry) {
MCRVIAFAuthorityFileUtils.LOGGER.info("Start import GND entry");
String projectID = "CommonVIAF";
String baseID = projectID + "_viaf";
String gnd = entry;
if (entry == null || entry.trim().length() == 0) {
MCRVIAFAuthorityFileUtils.LOGGER.error("missing entry for import VIAF");
return;
}
if ((!MCRVIAFAuthorityFileUtils.AI.checkPermission("create-" + baseID))
&& (!MCRAccessManager.checkPermission("create-viaf"))) {
MCRVIAFAuthorityFileUtils.LOGGER.error("access deny");
return;
}
MCRVIAFAuthorityFileUtils.LOGGER.info(" Request for GND " + gnd + " for project " + projectID);
MCRResults results = MCRVIAFAuthorityFileUtils.existsGND(gnd);
if (results.getNumHits() == 0) {
MCRObjectID newID = MCRObjectID.getNextFreeId(projectID + "_viaf");
try {
MCRObject obj = MCRVIAFAuthorityFileUtils.getGNDAsMarc21XML(null, gnd);
obj.setId(newID);
MCRMetadataManager.update(obj);
} catch (Exception e) {
e.printStackTrace();
MCRVIAFAuthorityFileUtils.LOGGER.error("error while update dataset " + newID.toString());
}
} else {
MCRHit hit = results.getHit(0);
MCRVIAFAuthorityFileUtils.LOGGER.warn("GND " + gnd + " is stored in dataset " + hit.getID());
}
MCRVIAFAuthorityFileUtils.LOGGER.info("Stop import GND entry");
}
/**
* This method import the VIAF authority file entries from LCNAF for a given number
*/
@MCRCommand(syntax = "import lcnaf entry {0}", help = "Import an entry with number {0} from the LCNAF.", order = 20)
public final static void importEntryFromLCNAF(String entry) {
MCRVIAFAuthorityFileUtils.LOGGER.info("Start import LCNAF entry");
String projectID = "CommonVIAF";
String baseID = projectID + "_viaf";
String lcnaf = entry;
if (entry == null || entry.trim().length() == 0) {
MCRVIAFAuthorityFileUtils.LOGGER.error("missing entry for import VIAF");
return;
}
if ((!MCRVIAFAuthorityFileUtils.AI.checkPermission("create-" + baseID))
&& (!MCRAccessManager.checkPermission("create-viaf"))) {
MCRVIAFAuthorityFileUtils.LOGGER.error("access deny");
return;
}
MCRVIAFAuthorityFileUtils.LOGGER.info(" Request for LCNAF " + lcnaf + " for project " + projectID);
MCRResults results = MCRVIAFAuthorityFileUtils.existsLCNAF(lcnaf);
if (results.getNumHits() == 0) {
MCRObjectID newID = MCRObjectID.getNextFreeId(projectID + "_viaf");
try {
MCRObject obj = MCRVIAFAuthorityFileUtils.getLCNAFAsMarc21XML(null, lcnaf);
obj.setId(newID);
MCRMetadataManager.update(obj);
} catch (Exception e) {
e.printStackTrace();
MCRVIAFAuthorityFileUtils.LOGGER.error("error while update dataset " + newID.toString());
}
} else {
MCRHit hit = results.getHit(0);
MCRVIAFAuthorityFileUtils.LOGGER.warn("LCNAF " + lcnaf + " is stored in dataset " + hit.getID());
}
MCRVIAFAuthorityFileUtils.LOGGER.info("Stop import LCNAF entry");
}
/**
* This method update the VIAF authority file entries from the LCNAF and DNB
*/
@MCRCommand(syntax = "update gnd entries", help = "Update the VIAF entries from the LCNAF and DNB.", order = 10)
@MCRCommand(syntax = "update viaf entries", help = "Update the VIAF entries from the LCNAF and DNB.", order = 30)
public final static void updateVIAFEntries() {
LOGGER.info("Start update VIAF entries");
MCRVIAFAuthorityFileUtils.LOGGER.info("Start update VIAF entries");
// get list of viaf
MCRQueryCondition viaf_cond = new MCRQueryCondition("objectType", "=", "viaf");
MCRQuery viaf_query = new MCRQuery(viaf_cond);
MCRResults viaf_result = MCRQueryManager.search(viaf_query);
int maxresults = viaf_result.getNumHits();
Iterator<MCRHit> viaf_iter = viaf_result.iterator();
// actual dataset count
int counter = 0;
while (viaf_iter.hasNext()) {
MCRHit viaf_hit = viaf_iter.next();
String viaf_id = viaf_hit.getID();
counter++;
LOGGER.info("Processing dataset " + counter + " from " + maxresults + " with ID: " + viaf_id);
MCRVIAFAuthorityFileUtils.LOGGER.info("Processing dataset " + counter + " from " + maxresults + " with ID: " + viaf_id);
MCRObject viaf_obj = MCRMetadataManager.retrieveMCRObject(MCRObjectID.getInstance(viaf_id));
MCRMetaElement viaf_identifier = viaf_obj.getMetadata().getMetadataElement("def.identifier");
if (viaf_identifier == null) {
LOGGER.error("Object " + viaf_id + " has not an identifier. Continue.");
MCRVIAFAuthorityFileUtils.LOGGER.error("Object " + viaf_id + " has not an identifier. Continue.");
continue;
}
MCRMetaLangText viaf_text = (MCRMetaLangText) viaf_identifier.getElementByName("identifier");
if (viaf_text == null) {
LOGGER.error("Object " + viaf_id + " has not an identifier. Continue.");
MCRVIAFAuthorityFileUtils.LOGGER.error("Object " + viaf_id + " has not an identifier. Continue.");
continue;
}
String type = viaf_text.getType();
if (type.equals("local")) {
LOGGER.debug("Object " + viaf_id + " is a local dataset. Continue.");
MCRVIAFAuthorityFileUtils.LOGGER.debug("Object " + viaf_id + " is a local dataset. Continue.");
continue;
} else
if (type.equals("gnd")) {
LOGGER.debug("Object " + viaf_id + " is a gnd dataset");
} else if (type.equals("gnd")) {
MCRVIAFAuthorityFileUtils.LOGGER.debug("Object " + viaf_id + " is a gnd dataset");
try {
MCRObject new_obj = MCRVIAFAuthorityFileUtils.getGNDAsMarc21XML(null, viaf_text.getText());
MCRVIAFAuthorityFileUtils.updateVIAF(viaf_obj, new_obj);
} catch (Exception e) {
LOGGER.error("Error while update MCRObject " + viaf_id + ". Continue.");
e.printStackTrace();
MCRVIAFAuthorityFileUtils.LOGGER.error("Error while update MCRObject " + viaf_id + ". Continue.");
}
continue;
} else
if (type.equals("lcnaf")) {
LOGGER.debug("Object " + viaf_id + " is a lcnaf dataset");
try {
MCRObject new_obj = MCRVIAFAuthorityFileUtils.getLCNAFAsMarc21XML(null, viaf_text.getText());
MCRVIAFAuthorityFileUtils.updateVIAF(viaf_obj, new_obj);
} catch (Exception e) {
LOGGER.error("Error while update MCRObject " + viaf_id + ". Continue.");
}
continue;
} else {
LOGGER.warn("Object " + viaf_id + " has an unknown identifier. Continue.");
continue;
} else if (type.equals("lcnaf")) {
MCRVIAFAuthorityFileUtils.LOGGER.debug("Object " + viaf_id + " is a lcnaf dataset");
try {
MCRObject new_obj = MCRVIAFAuthorityFileUtils.getLCNAFAsMarc21XML(null, viaf_text.getText());
MCRVIAFAuthorityFileUtils.updateVIAF(viaf_obj, new_obj);
} catch (Exception e) {
e.printStackTrace();
MCRVIAFAuthorityFileUtils.LOGGER.error("Error while update MCRObject " + viaf_id + ". Continue.");
}
continue;
} else {
MCRVIAFAuthorityFileUtils.LOGGER.warn("Object " + viaf_id + " has an unknown identifier. Continue.");
continue;
}
}
LOGGER.info("Stop update VIAF entries");
MCRVIAFAuthorityFileUtils.LOGGER.info("Stop update VIAF entries");
}
}
\ No newline at end of file
......@@ -20,8 +20,6 @@
package org.mycore.frontend.servlets.gnd;
import java.text.MessageFormat;
import org.mycore.access.MCRAccessManager;
import org.mycore.common.MCRException;
import org.mycore.datamodel.metadata.MCRMetadataManager;
......@@ -31,9 +29,6 @@ import org.mycore.frontend.MCRVIAFAuthorityFileUtils;
import org.mycore.frontend.servlets.MCRServlet;
import org.mycore.frontend.servlets.MCRServletJob;
import org.mycore.services.fieldquery.MCRHit;
import org.mycore.services.fieldquery.MCRQuery;
import org.mycore.services.fieldquery.MCRQueryManager;
import org.mycore.services.fieldquery.MCRQueryParser;
import org.mycore.services.fieldquery.MCRResults;
/**
......@@ -60,7 +55,7 @@ public class MCRGNDEntityByPublicIDServlet extends MCRServlet {
throw new MCRException("You must provide a gnd in order to use this servlet");
}
MCRVIAFAuthorityFileUtils.LOGGER.info(" Request for GND " + gnd + " for project " + projectID);
MCRResults results = exists(gnd);
MCRResults results = MCRVIAFAuthorityFileUtils.existsGND(gnd);
if (results.getNumHits() == 0) {
MCRObject obj = MCRVIAFAuthorityFileUtils.getGNDAsMarc21XML(job, gnd);
MCRObjectID newID = MCRObjectID.getNextFreeId(projectID + "_viaf");
......@@ -75,19 +70,4 @@ public class MCRGNDEntityByPublicIDServlet extends MCRServlet {
}
}
/**
* Checks whether a authority file with the given gnd exists or not
*
* @param gnd
* the GND number
* @return <code>true</code>, if the authority file exists, <code>false</code>
* otherwise
*/
private MCRResults exists(String gnd) {
String qString = MessageFormat.format("(objectType = \"viaf\") AND (viafidgnd = \"{1}\")", gnd);
MCRQuery query = new MCRQuery(new MCRQueryParser().parse(qString));
MCRResults results = MCRQueryManager.search(query);
return results;
}
}
......@@ -3,8 +3,6 @@
*/
package org.mycore.frontend.servlets.lcnaf;
import java.text.MessageFormat;
import org.mycore.access.MCRAccessManager;
import org.mycore.common.MCRException;
import org.mycore.datamodel.metadata.MCRMetadataManager;
......@@ -14,9 +12,6 @@ import org.mycore.frontend.MCRVIAFAuthorityFileUtils;
import org.mycore.frontend.servlets.MCRServlet;
import org.mycore.frontend.servlets.MCRServletJob;
import org.mycore.services.fieldquery.MCRHit;
import org.mycore.services.fieldquery.MCRQuery;
import org.mycore.services.fieldquery.MCRQueryManager;
import org.mycore.services.fieldquery.MCRQueryParser;
import org.mycore.services.fieldquery.MCRResults;
/**
......@@ -40,7 +35,7 @@ public class MCRLCNAFEntityByPublicIDServlet extends MCRServlet {
throw new MCRException("You must provide a lcnaf in order to use this servlet");
}
MCRVIAFAuthorityFileUtils.LOGGER.info(" Request for LCNAF " + lcnaf + " for project " + projectID);
MCRResults results = exists(lcnaf);
MCRResults results = MCRVIAFAuthorityFileUtils.existsLCNAF(lcnaf);
if (results.getNumHits() == 0) {
MCRObject obj = MCRVIAFAuthorityFileUtils.getLCNAFAsMarc21XML(job, lcnaf);
MCRObjectID newID = MCRObjectID.getNextFreeId(projectID + "_viaf");
......@@ -54,19 +49,4 @@ public class MCRLCNAFEntityByPublicIDServlet extends MCRServlet {
}
}
/**
* Checks whether a person with the given gnd exists or not
*
* @param lcnaf
* the LoC number
* @return <code>true</code>, if the person exists, <code>false</code>
* otherwise
*/
private MCRResults exists(String lcnaf) {
String qString = MessageFormat.format("(objectType = \"viaf\") AND (viafidlcnaf = \"{0}\")", lcnaf);
MCRQuery query = new MCRQuery(new MCRQueryParser().parse(qString));
MCRResults results = MCRQueryManager.search(query);
return results;
}
}
......@@ -4,16 +4,16 @@
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:marc21="xalan://org.mycore.frontend.marc21.MCRGetIDForMarc21"
xmlns:xalan="http://xml.apache.org/xalan" xmlns:marcxml="http://www.loc.gov/MARC21/slim" extension-element-prefixes="marc21 xlink xalan">
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:variable name="mcrid" select="'a_viaf_1'" />
<xsl:variable name="mcrid" select="'a_viaf_1'"/>
<xsl:variable name="identifier">
<xsl:value-of select="/marcxml:record/marcxml:controlfield[@tag='001']/text()" />
<xsl:value-of select="/marcxml:record/marcxml:controlfield[@tag='001']/text()"/>
</xsl:variable>
<mycoreobject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink"
label="{$identifier}" ID="{$mcrid}" version="2.0" xsi:noNamespaceSchemaLocation="datamodel-viaf.xsd">
<structure />
<structure/>
<metadata>
<!-- preferredName -->
<def.preferredName class="MCRMetaPersonName" heritable="false" notinherit="true">
......@@ -21,22 +21,22 @@
<preferredName inherited="0" xml:lang="en">
<xsl:if test="@ind1 = '0' and marcxml:subfield[@code = 'a']">
<callname>
<xsl:value-of select="marcxml:subfield[@code = 'a']/text()" />
<xsl:value-of select="marcxml:subfield[@code = 'a']/text()"/>
</callname>
</xsl:if>
<xsl:if test="@ind1 = '0' and marcxml:subfield[@code = 'b']">
<numeration>
<xsl:value-of select="marcxml:subfield[@code = 'b']/text()" />
<xsl:value-of select="marcxml:subfield[@code = 'b']/text()"/>
</numeration>
</xsl:if>
<xsl:if test="@ind1 = '0' and marcxml:subfield[@code = 'c']">
<title>
<xsl:value-of select="marcxml:subfield[@code = 'c']/text()" />
<xsl:value-of select="marcxml:subfield[@code = 'c']/text()"/>
</title>
</xsl:if>
<xsl:if test="@ind1 = '1' and marcxml:subfield[@code = 'a']">
<fullname>
<xsl:value-of select="marcxml:subfield[@code = 'a']/text()" />
<xsl:value-of select="marcxml:subfield[@code = 'a']/text()"/>
</fullname>
</xsl:if>
</preferredName>
......@@ -49,22 +49,22 @@
<variantName inherited="0" xml:lang="en">
<xsl:if test="@ind1 = '0' and marcxml:subfield[@code = 'a']">
<callname>
<xsl:value-of select="marcxml:subfield[@code = 'a']/text()" />
<xsl:value-of select="marcxml:subfield[@code = 'a']/text()"/>
</callname>
</xsl:if>
<xsl:if test="@ind1 = '0' and marcxml:subfield[@code = 'b']">
<numeration>
<xsl:value-of select="marcxml:subfield[@code = 'b']/text()" />
<xsl:value-of select="marcxml:subfield[@code = 'b']/text()"/>
</numeration>
</xsl:if>
<xsl:if test="@ind1 = '0' and marcxml:subfield[@code = 'c']">
<title>
<xsl:value-of select="marcxml:subfield[@code = 'c']/text()" />
<xsl:value-of select="marcxml:subfield[@code = 'c']/text()"/>
</title>
</xsl:if>
<xsl:if test="@ind1 = '1' and marcxml:subfield[@code = 'a']">
<fullname>
<xsl:value-of select="marcxml:subfield[@code = 'a']/text()" />
<xsl:value-of select="marcxml:subfield[@code = 'a']/text()"/>
</fullname>
</xsl:if>
</variantName>
......@@ -74,27 +74,124 @@
<!-- recordType -->
<def.recordType class="MCRMetaLangText" heritable="false" notinherit="true">
<recordType inherited="0" xml:lang="en">
<xsl:value-of select="'person'" />
<xsl:value-of select="'person'"/>
</recordType>
</def.recordType>
<!-- recordSource -->
<def.recordSource class="MCRMetaClassification" heritable="false" notinherit="true">
<recordSource inherited="0" classid="viafRecordSource" categid="gnd" />
<recordSource inherited="0" classid="viafRecordSource" categid="gnd"/>
</def.recordSource>
<!-- identifier -->
<def.identifier class="MCRMetaLangText" heritable="false" notinherit="true">
<identifier inherited="0" xml:lang="en" type="gnd">
<xsl:value-of select="$identifier" />
<xsl:value-of select="$identifier"/>
</identifier>
</def.identifier>
<!-- firstDate / secondDate -->
<xsl:for-each select="/marcxml:record/marcxml:datafield[@tag='548']">
<xsl:if test="marcxml:subfield[@code='i']/text() = 'Exakte Lebensdaten' and contains(marcxml:subfield[@code='a']/text(),'-')">
<def.firstDate class="MCRMetaHistoryDate" heritable="false" notinherit="true">
<firstDate inherited="0">
<text xml:lang="de">
<xsl:value-of select="substring-before(marcxml:subfield[@code='a']/text(),'-')"/>
</text>
<von>
<xsl:value-of select="substring-before(marcxml:subfield[@code='a']/text(),'-')"/>
</von>
<bis>
<xsl:value-of select="substring-before(marcxml:subfield[@code='a']/text(),'-')"/>
</bis>
<calendar>gregorian</calendar>
</firstDate>
</def.firstDate>
<def.secondDate class="MCRMetaHistoryDate" heritable="false" notinherit="true">
<secondDate inherited="0">
<text xml:lang="de">
<xsl:value-of select="substring-after(marcxml:subfield[@code='a']/text(),'-')"/>
</text>
<von>
<xsl:value-of select="substring-after(marcxml:subfield[@code='a']/text(),'-')"/>
</von>
<bis>
<xsl:value-of select="substring-after(marcxml:subfield[@code='a']/text(),'-')"/>
</bis>
<calendar>gregorian</calendar>
</secondDate>
</def.secondDate>
</xsl:if>
</xsl:for-each>
<!-- firstPlace -->
<xsl:for-each select="/marcxml:record/marcxml:datafield[@tag='551']">
<xsl:if test="marcxml:subfield[@code='i']/text() = 'Geburtsort'">
<xsl:if test="marcxml:subfield[@code='a']">