<?xml version="1.0" encoding="UTF-8"?>
<!-- 
  DANMARC2-TO-DKABM PROJECT

  $Id: danmarc2_til_dkabm.xsl,v 1.15 2009-08-20 13:26:18 adam Exp $  

  These XSLT stylesheets are used for conversion of DANMARC2
  XML records in the MARCXCHANGE format to the XML format for archives,
  libraries and museum (short called ABM format), see 

  http://www.bs.dk/standards/abm/

  Usage: on GNU/Debian Linux, for example, one can issue the command

  xsltproc xslt/danmarc2_til_dkabm.xsl test/collection.marcxchange 
      >  test/collection.abm

  Copyright (c) 2007-2008: Index Data, http://www.indexdata.com
  Author: Marc Cromme, Index Data ApS
  License: GNU public license
  
  See the LICENSE file for details
-->
<xslt:stylesheet version="1.0"
  xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
  xmlns:mxch="info:lc/xmlns/marcxchange-v1"
  xmlns:ac="http://biblstandard.dk/ac/namespace/"
  xmlns:dkabm="http://biblstandard.dk/abm/namespace/dkabm/" 
  xmlns:dkdcplus="http://biblstandard.dk/abm/namespace/dkdcplus/"
  xmlns:dc="http://purl.org/dc/elements/1.1/" 
  xmlns:dcterms="http://purl.org/dc/terms/" 
  xmlns:dcmitype="http://purl.org/dc/dcmitype/" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://biblstandard.dk/abm/namespace/dkabm/ http://biblstandard.dk/abm/schemas/dkabm_2008-11-19.xsd"
  exclude-result-prefixes="mxch">

  <xslt:import href="danmarc2_til_dkabm_marcxchange.xsl"/>
  <xslt:import href="danmarc2_til_dkabm_material.xsl"/>
  <xslt:import href="danmarc2_til_dkabm_dk5.xsl"/>
  <xslt:import href="danmarc2_til_dkabm_lang.xsl"/>

  <xslt:output method="xml" indent="yes"/>

  <xslt:param name="url_base">http://www.bibliotek.dk/linkme.php</xslt:param>
  <xslt:param name="url_start">?ccl=lid%3D</xslt:param>
  <xslt:param name="url_middle">+og+lok%3D</xslt:param>
  <xslt:param name="url_end"></xslt:param>
  
  <xslt:template match="text()"/>
  
  <xslt:template match="/mxch:collection">
    <dkabm:collection>
      <xslt:apply-templates/>
    </dkabm:collection>
  </xslt:template>

  <xslt:template match="mxch:record">
    <dkabm:record>
      <xslt:apply-templates/>
      <xslt:call-template name="marc_rules"/>
      <xslt:call-template name="material_type"/>
      <xslt:call-template name="dk5_type"/>
      <xslt:call-template name="language_rules"/>
    </dkabm:record> 
  </xslt:template>

</xslt:stylesheet>

