[Koha] import with file.xsl

Katrin Fischer katrin.fischer.83 at web.de
Sat Dec 15 01:16:44 NZDT 2018


Hi Anabela,

I am sorry, I don't think I will be able to help here. Maybe someone 
else has an idea.

Katrin

On 07.12.18 16:34, anabela semedo wrote:
>   <xsl:template name="transform-100">
>    <xsl:variable name="source" select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
>    <xsl:variable name="source-105" select="marc:datafield[@tag='105']"/>
>    <xsl:variable name="source-106" select="marc:datafield[@tag='106']"/>
>    <xsl:variable name="dest00-05" select="substring($source,03,6)"/>
>
>     <xsl:variable name="dest06" 
> select="translate(substring($source,09,1), 'abcdefghij', 'cdusrqmtpe')"/>
>     <xsl:variable name="dest07-14" select="substring($source,10,8)"/>
>     <xsl:variable name="dest15-17" select="'   '"/>
>     <xsl:variable name="dest18" 
> select="translate(substring($source-105,1,1), 'abcdefghijklmnopy 
> |','abcdefghijklmaop  |')"/>
>     <xsl:variable name="dest19" 
> select="translate(substring($source-105,2,1), 'abcdefghijklmnopy 
> |','abcdefghijklmaop  |')"/>
>     <xsl:variable name="dest20" 
> select="translate(substring($source-105,3,1), 'abcdefghijklmnopy 
> |','abcdefghijklmaop  |')"/>
>     <xsl:variable name="dest21" 
> select="translate(substring($source-105,4,1), 'abcdefghijklmnopy 
> |','abcdefghijklmaop  |')"/>
>     <xsl:variable name="dest22" 
> select="translate(substring($source,18,1), 'bcadekmu|', 'abjcdeg||')"/>
>     <xsl:variable name="dest23">
>     <xsl:choose>
>     <xsl:when test="$source-106">
> <xsl:value-of select="translate(substring($source-106,1,1), 
> 'abcdfghiryz|','abcdfghir z|')"/>
>     </xsl:when>
>     <xsl:otherwise>
>         <xsl:value-of select="'|'"/>
>     </xsl:otherwise>
>     </xsl:choose>
>     </xsl:variable>
>     <xsl:variable name="dest24" 
> select="translate(substring($source-105,5,1), ' 
> abcdefghijklmnopqrz|',' bciaderysp   l t n |')"/>
>     <xsl:variable name="dest25" 
> select="translate(substring($source-105,6,1), ' 
> abcdefghijklmnopqrz|',' bciaderysp   l t n |')"/>
>     <xsl:variable name="dest26" 
> select="translate(substring($source-105,7,1), ' 
> abcdefghijklmnopqrz|',' bciaderysp   l t n |')"/>
>     <xsl:variable name="dest27" 
> select="translate(substring($source-105,8,1), ' 
> abcdefghijklmnopqrz|',' bciaderysp   l t n |')"/>
>     <xsl:variable name="dest28" 
> select="translate(substring($source,21,1), 'abcdefghy|', 'fsllcizo||')"/>
>     <xsl:variable name="dest29-32" select="'||||'"/>
>     <xsl:variable name="dest33" 
> select="translate(substring($source-105,12,1), 
> 'abcdefghyz|','1||||1|||||')"/>
>     <xsl:variable name="dest34" 
> select="translate(substring($source-105,13,1), 'abcdy|','abcd |')"/>
>     <xsl:variable name="dest35-37" select="'   '"/>
>     <xsl:variable name="dest38" 
> select="translate(substring($source,22,1), '01', ' o')"/>
>     <xsl:variable name="dest39-40" select="'||'"/>
>     <marc:controlfield tag="008">
>       <xsl:value-of select="concat($dest00-05, $dest06, $dest07-14, 
> $dest15-17, $dest18, $dest19, $dest20, $dest21, $dest22, $dest23, 
> $dest24, $dest25, $dest26, $dest27, $dest28, $dest29-32, $dest33, 
> $dest34, $dest35-37, $dest38, $dest39-40)"/>
>     </marc:controlfield>
>   </xsl:template>
>   <xsl:template name="transform-datafield">
>     <xsl:param name="srcTag"/>
>     <xsl:param name="dstTag" select="@srcTag"/>
>     <xsl:param name="srcCodes" select="$all-codes"/>
>     <xsl:param name="dstCodes" select="$srcCodes"/>
>     <xsl:if 
> test="marc:datafield[@tag=$srcTag]/marc:subfield[contains($srcCodes, 
> @code)]">
>       <xsl:for-each select="marc:datafield[@tag=$srcTag]">
>         <marc:datafield tag="{$dstTag}">
>           <xsl:call-template name="copy-indicators"/>
>           <xsl:call-template name="transform-subfields">
>             <xsl:with-param name="srcCodes" select="$srcCodes"/>
>             <xsl:with-param name="dstCodes" select="$dstCodes"/>
>           </xsl:call-template>
>         </marc:datafield>
>       </xsl:for-each>
>     </xsl:if>


More information about the Koha mailing list