Skip to content

Commit

Permalink
Fixes #246 and corrects unpaired 880 output. Update version number.
Browse files Browse the repository at this point in the history
  • Loading branch information
kefo committed Sep 29, 2024
1 parent 0a7364e commit 5cd2eb3
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 41 deletions.
2 changes: 1 addition & 1 deletion IDMETA
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NAME=marc2bibframe2
CENTOS_DIST="centos7 centos8"
VERSION=2.0.2
VERSION=2.0.3
10 changes: 5 additions & 5 deletions test/marc2bibframe2.xspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<bf:AdminMetadata>
<bf:generationProcess>
<bf:GenerationProcess>
<rdfs:label>DLC marc2bibframe2 v2.0.2</rdfs:label>
<rdfs:label>DLC marc2bibframe2 v2.0.3</rdfs:label>
<bf:generationDate rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">1970-01-01T00:00:00Z</bf:generationDate>
</bf:GenerationProcess>
</bf:generationProcess>
Expand Down Expand Up @@ -224,7 +224,7 @@
<bf:AdminMetadata>
<bf:generationProcess>
<bf:GenerationProcess>
<rdfs:label>DLC marc2bibframe2 v2.0.2</rdfs:label>
<rdfs:label>DLC marc2bibframe2 v2.0.3</rdfs:label>
<bf:generationDate rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">1970-01-01T00:00:00Z</bf:generationDate>
</bf:GenerationProcess>
</bf:generationProcess>
Expand Down Expand Up @@ -427,7 +427,7 @@
<bf:AdminMetadata>
<bf:generationProcess>
<bf:GenerationProcess>
<rdfs:label>DLC marc2bibframe2 v2.0.2</rdfs:label>
<rdfs:label>DLC marc2bibframe2 v2.0.3</rdfs:label>
<bf:generationDate rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">1970-01-01T00:00:00Z</bf:generationDate>
</bf:GenerationProcess>
</bf:generationProcess>
Expand Down Expand Up @@ -679,7 +679,7 @@
<bf:AdminMetadata>
<bf:generationProcess>
<bf:GenerationProcess>
<rdfs:label>DLC marc2bibframe2 v2.0.2</rdfs:label>
<rdfs:label>DLC marc2bibframe2 v2.0.3</rdfs:label>
<bf:generationDate rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">1970-01-01T00:00:00Z</bf:generationDate>
</bf:GenerationProcess>
</bf:generationProcess>
Expand Down Expand Up @@ -1035,7 +1035,7 @@
<bf:AdminMetadata>
<bf:generationProcess>
<bf:GenerationProcess>
<rdfs:label>DLC marc2bibframe2 v2.0.2</rdfs:label>
<rdfs:label>DLC marc2bibframe2 v2.0.3</rdfs:label>
<bf:generationDate rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">1970-01-01T00:00:00Z</bf:generationDate>
</bf:GenerationProcess>
</bf:generationProcess>
Expand Down
46 changes: 20 additions & 26 deletions xsl/ConvSpec-Process6-Series.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -233,42 +233,36 @@
</bf:status>
</identifiedBy>
</xsl:if>


<xsl:if test="$vLcc != ''">
<bf:classification>
<bf:ClassificationLcc>
<bf:assigner>
<bf:Agent
rdf:about="http://id.loc.gov/vocabulary/organizations/dlc"/>
</bf:assigner>
<bf:classificationPortion>
<xsl:value-of select="$vLcc"/>
</bf:classificationPortion>
</bf:ClassificationLcc>
</bf:classification>
</xsl:if>
</bf:Hub>
<xsl:if test="$vLcc != ''">
<bf:classification>
<bf:ClassificationLcc>
<bf:assigner>
<bf:Agent
rdf:about="http://id.loc.gov/vocabulary/organizations/dlc"/>
</bf:assigner>
<bf:classificationPortion>
<xsl:value-of select="$vLcc"/>
</bf:classificationPortion>
</bf:ClassificationLcc>
</bf:classification>

</xsl:if>

<xsl:if test="$vAppliesTo != ''">
<bflc:appliesTo>
<bflc:AppliesTo>
<xsl:value-of select="$vAppliesTo"/>
</bflc:AppliesTo>
</bflc:appliesTo>
</xsl:if>
</bf:relatedTo>
<xsl:if test="$vAppliesTo != ''">
<bflc:appliesTo>
<bflc:AppliesTo>
<xsl:value-of select="$vAppliesTo"/>
</bflc:AppliesTo>
</bflc:appliesTo>
</xsl:if>
<xsl:if test="$vEnumeration != ''">
<bf:seriesEnumeration>
<xsl:value-of select="$vEnumeration"/>
</bf:seriesEnumeration>
</xsl:if>
<xsl:if
test="$v880Enumeration != '' and not($vEnumeration = $v880Enumeration)">

<xsl:copy-of select="$v880Enumeration"/>

</xsl:if>
</bflc:Relationship>
</bflc:relationship>
Expand Down
55 changes: 47 additions & 8 deletions xsl/ConvSpec-Process8-ProvAct.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@
<xsl:variable name="v880Ref">
<xsl:value-of select="concat('880-', $v880Occurrence)"/>
</xsl:variable>
<xsl:variable name="relatedField" select="../marc:datafield[@tag = $vTag and contains(marc:subfield[@code = '6'], $v880Ref)]"
/>
<xsl:copy-of select="$relatedField"/>

<!-- Is this 880 related to a 26X field in this record? -->
<xsl:variable name="relatedField" select="../marc:datafield[@tag = $vTag and contains(marc:subfield[@code = '6'], $v880Ref)]" />

<!-- commented out on 30 Aug 2024. Did doing this break something? -->
<!-- <xsl:copy-of select="$relatedField"/> -->

<!-- If no related field was found, then we have an unpaied 880. We need to output it. -->
<xsl:if test="count($relatedField/marc:*) = 0">
<xsl:variable name="dfFrom880-prenodeset">
<marc:datafield>
Expand Down Expand Up @@ -221,11 +226,22 @@
</bf:Status>
</bf:status>
</xsl:if>
<xsl:apply-templates
select="$df/marc:sf[@code = '3'] | marc:df[@tag = '880']/marc:sf[@code = '3']"
mode="subfield3">
<xsl:with-param name="serialization" select="$serialization"/>
</xsl:apply-templates>
<xsl:choose>
<xsl:when test="$df/marc:sf[@code = '3']">
<xsl:apply-templates
select="$df/marc:sf[@code = '3'][1]"
mode="subfield3">
<xsl:with-param name="serialization" select="$serialization"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="marc:df[@tag = '880']/marc:sf[@code = '3']">
<xsl:apply-templates
select="marc:df[@tag = '880']/marc:sf[@code = '3'][1]"
mode="subfield3">
<xsl:with-param name="serialization" select="$serialization"/>
</xsl:apply-templates>
</xsl:when>
</xsl:choose>
<xsl:for-each select="$df/marc:sf[@code = 'a']">
<xsl:variable name="sfPos" select="@pos"/>
<xsl:variable name="vLabel">
Expand Down Expand Up @@ -525,6 +541,18 @@
<xsl:variable name="sf" select="$df/marc:subfield[$pos]"/>

<xsl:choose>
<xsl:when test="$sf/@code = '3' or $sf/@code = '6'">
<marc:sf>
<xsl:copy-of select="$sf/@*"/>
<xsl:attribute name="gpos">
<xsl:value-of select="$gpos"/>
</xsl:attribute>
<xsl:attribute name="pos">
<xsl:value-of select="$pos"/>
</xsl:attribute>
<xsl:copy-of select="$sf/text()"/>
</marc:sf>
</xsl:when>
<xsl:when test="$df/@tag = '261' and ($sf/@code = 'a' or $sf/@code = 'b')">
<xsl:variable name="map260sfs">
<m sfCode="a">b</m>
Expand Down Expand Up @@ -637,6 +665,17 @@
<xsl:with-param name="pos" select="$next_pos"/>
</xsl:call-template>
</xsl:when>
<xsl:when
test="
($sf/@code = '6' and $df/marc:subfield[$next_pos][@code = '3' or @code = 'a'])
or
($sf/@code = '3' and $df/marc:subfield[$next_pos][@code = 'a'])">
<xsl:call-template name="parse26x">
<xsl:with-param name="df" select="$df"/>
<xsl:with-param name="gpos" select="$gpos"/>
<xsl:with-param name="pos" select="$next_pos"/>
</xsl:call-template>
</xsl:when>
<xsl:when
test="
($sf/@code = 'a' and $df/marc:subfield[$next_pos][@code = 'a'])
Expand Down
2 changes: 1 addition & 1 deletion xsl/variables.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- constants for marc2bibframe2.xsl -->

<!-- Current marc2bibframe2 version -->
<xsl:variable name="vCurrentVersion">v2.0.2</xsl:variable>
<xsl:variable name="vCurrentVersion">v2.0.3</xsl:variable>

<!-- namespace URIs -->
<xsl:variable name="bf">http://id.loc.gov/ontologies/bibframe/</xsl:variable>
Expand Down

0 comments on commit 5cd2eb3

Please sign in to comment.