Converta DublinCore Para MARC

1

Estou tentando converter o seguinte catálogo XML DublinCore:

<?xml version="1.0" encoding="UTF-8"?>
<articlesinDublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
<article>
  <dc:creator>Laura Steinert</dc:creator>
  <dc:creator>Ulrich Hoppe</dc:creator>
  <dc:language>English</dc:language>
  <dc:date>2015-09-16</dc:date>
  <dc:title>Using Network Analytics for the Recommendation of Scientific Papers
  </dc:title>
  <dc:format>PDF</dc:format>
  <dc:publisher>Springer</dc:publisher>
  <dc:type>Text</dc:type>
</article>
<article>
<dc:contributor>Nicholas Baloian</dc:contributor>
<dc:contributor>Yasser Zorian</dc:contributor>
  <dc:language>English</dc:language>
  <dc:date>2015-09-16</dc:date>      
  <dc:title>Collaboration and Technology</dc:title>
  <dc:format>PDF</dc:format>      
  <dc:publisher>Springer</dc:publisher>
  <dc:type>Collection</dc:type>
</article>
</articlesinDublinCore>

para um catálogo MARC usando o arquivo oficial XLST da seguinte forma:

    

<xsl:template match="/">
    <record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:schemaLocation="http://www.loc.gov/MARC21/slim 
        http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd"  > 
        <datafield tag="042" ind1=" " ind2=" ">
            <subfield code="a">dc</subfield>
        </datafield>

        <xsl:for-each select="//dc:contributor">
            <datafield tag="720" ind1="0" ind2="0">
                <subfield code="a">
                    <xsl:value-of select="."/>
                </subfield>
                <subfield code="e">collaborator</subfield>
            </datafield>
        </xsl:for-each>

        <xsl:for-each select="//dc:coverage">
            <datafield tag="500" ind1=" " ind2=" ">
                <subfield code="a">
                    <xsl:value-of select="."/>
                </subfield>
            </datafield>
        </xsl:for-each>

        <xsl:for-each select="//dc:creator">
            <datafield tag="720" ind1=" " ind2=" ">
                <subfield code="a">
                    <xsl:value-of select="."/>
                </subfield>
                <subfield code="e">author</subfield>
            </datafield>
        </xsl:for-each>

        <xsl:for-each select="//dc:date">
            <datafield tag="260" ind1=" " ind2=" ">
                <subfield code="c">
                    <xsl:value-of select="."/>
                </subfield>
            </datafield>
        </xsl:for-each> 

        <xsl:for-each select="//dc:description">
            <datafield tag="520" ind1=" " ind2=" ">
                <subfield code="a">
                    <xsl:value-of select="."/>
                </subfield>
            </datafield>
        </xsl:for-each>

        <xsl:for-each select="//dc:format">
            <datafield tag="856" ind1=" " ind2=" ">
                <subfield code="q">
                    <xsl:value-of select="."/>
                </subfield>
            </datafield>
        </xsl:for-each>

        <xsl:for-each select="//dc:identifier">
            <datafield tag="024" ind1="8" ind2=" ">
                <subfield code="a">
                    <xsl:value-of select="."/>
                </subfield>
            </datafield>
        </xsl:for-each>

        <xsl:for-each select="//dc:language">
            <datafield tag="546" ind1=" " ind2=" ">
                <subfield code="a">
                    <xsl:value-of select="."/>
                </subfield>
            </datafield>
        </xsl:for-each>

        <xsl:for-each select="//dc:publisher">
            <datafield tag="260" ind1=" " ind2=" ">
                <subfield code="b">
                    <xsl:value-of select="."/>
                </subfield>
            </datafield>
        </xsl:for-each>

        <xsl:for-each select="//dc:relation">
            <datafield tag="787" ind1="0" ind2=" ">
                <subfield code="n">
                    <xsl:value-of select="."/>
                </subfield>
            </datafield>
        </xsl:for-each>

        <xsl:for-each select="//dc:rights">
            <datafield tag="540" ind1=" " ind2=" ">
                <subfield code="a">
                    <xsl:value-of select="."/>
                </subfield>
            </datafield>
        </xsl:for-each>

        <xsl:for-each select="//dc:source">
            <datafield tag="786" ind1="0" ind2=" ">
                <subfield code="n">
                    <xsl:value-of select="."/>
                </subfield>
            </datafield>
        </xsl:for-each>

        <xsl:for-each select="//dc:subject">
            <datafield tag="653" ind1=" " ind2=" ">
                <subfield code="a">
                    <xsl:value-of select="."/>
                </subfield>
            </datafield>
        </xsl:for-each>

        <xsl:for-each select="//dc:title[1]">
            <datafield tag="245" ind1="0" ind2="0">
                <subfield code="a">
                    <xsl:value-of select="."/>
                </subfield>
            </datafield>
        </xsl:for-each>

        <xsl:for-each select="//dc:title[position()>1]">
            <datafield tag="246" ind1="3" ind2="3">
                <subfield code="a">
                    <xsl:value-of select="."/>
                </subfield>
            </datafield>
        </xsl:for-each>

        <xsl:for-each select="//dc:type">
            <datafield tag="655" ind1="7" ind2=" ">
                <subfield code="a">
                    <xsl:value-of select="."/>
                </subfield>
                <subfield code="2">local</subfield>
            </datafield>
        </xsl:for-each>
    </record>
</xsl:template>

O arquivo convertido resultante está acumulando todos os elementos em dois artigos em um único registro, como segue (estou citando apenas uma parte dele):

<?xml version="1.0" encoding="utf-8"?>
<record xmlns="http://www.loc.gov/MARC21/slim"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/MARC21/slim              http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd">
<datafield tag="042" ind1=" " ind2=" ">
<subfield code="a">dc</subfield>
</datafield>
<datafield tag="720" ind1="0" ind2="0">
  <subfield code="a">Nicholas Baloian</subfield>
  <subfield code="e">collaborator</subfield>
</datafield>
<datafield tag="720" ind1="0" ind2="0">
  <subfield code="a">Yasser Zorian</subfield>
  <subfield code="e">collaborator</subfield>
</datafield>
</record>

No entanto, o que eu preciso é converter a coleção de elementos em DoublineCore em uma coleção de elementos no formato MARC. Alguém tem uma idéia de como eu posso editar a expressão XPATH no arquivo XLST (segundo bloco de código) para obter o resultado desejado?

Obrigado antecipadamente.

    
por Pouria 02.11.2015 / 22:08

0 respostas

Tags