Skip to content

Commit

Permalink
Fix FA generation, refs #10591
Browse files Browse the repository at this point in the history
- Restore archdesc/dsc check, removed in 0d71fb5 and causing
  a `java.lang.NullPointerException` in the FOP command.
- Fix FA bookmarks, get head or unittitle value instead of
  aplying their templates in bookmarks as the bookmark titles
  don't accept block elements.
  • Loading branch information
jraddaoui committed Jul 10, 2020
1 parent 6cba402 commit 381f849
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
4 changes: 2 additions & 2 deletions lib/task/pdf/ead-pdf-full-details.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,10 @@
<fo:bookmark-title>
<xsl:choose>
<xsl:when test="ead:head">
<xsl:apply-templates select="child::*/ead:head"/>
<xsl:value-of select="child::*/ead:head[1]"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="child::*/ead:unittitle"/>
<xsl:value-of select="child::*/ead:unittitle[1]"/>
</xsl:otherwise>
</xsl:choose>
</fo:bookmark-title>
Expand Down
52 changes: 27 additions & 25 deletions lib/task/pdf/ead-pdf-inventory-summary.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,10 @@
<fo:bookmark-title>
<xsl:choose>
<xsl:when test="ead:head">
<xsl:apply-templates select="child::*/ead:head"/>
<xsl:value-of select="child::*/ead:head[1]"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="child::*/ead:unittitle"/>
<xsl:value-of select="child::*/ead:unittitle[1]"/>
</xsl:otherwise>
</xsl:choose>
</fo:bookmark-title>
Expand All @@ -438,10 +438,10 @@
<fo:bookmark-title>
<xsl:choose>
<xsl:when test="ead:head">
<xsl:apply-templates select="child::*/ead:head"/>
<xsl:value-of select="child::*/ead:head[1]"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="child::*/ead:unittitle"/>
<xsl:value-of select="child::*/ead:unittitle[1]"/>
</xsl:otherwise>
</xsl:choose>
</fo:bookmark-title>
Expand Down Expand Up @@ -1374,27 +1374,29 @@

<!-- Collection Inventory (dsc) templates -->
<xsl:template match="ead:archdesc/ead:dsc">
<fo:block xsl:use-attribute-sets="sectionTable" >
<fo:block xsl:use-attribute-sets="h2ID"><xsl:value-of select="local:tagName(.)"/></fo:block>
<fo:table table-layout="fixed" space-after="12pt" width="100%" font-size="10pt"
border-bottom="1pt solid #000" border-top="1pt solid #000"
border-left="1pt solid #000" border-right="1pt solid #000" text-align="left"
border-after-width.length="1pt" border-after-width.conditionality="retain"
border-before-width.length="1pt" border-before-width.conditionality="retain">

<fo:table-column column-number="1" column-width="1.25in" border-right="1pt solid #000"/>
<fo:table-column column-number="2" column-width="2.75in"/>
<fo:table-column column-number="3" column-width="1.3in"/>
<fo:table-column column-number="4" column-width="2.1in"/>

<fo:table-body start-indent="0in">
<xsl:if test="child::*[@level][1][@level='item' or @level='file' or @level='otherlevel']">
<xsl:call-template name="tableHeaders"/>
</xsl:if>
<xsl:apply-templates select="*[not(self::ead:head)]"/>
</fo:table-body>
</fo:table>
</fo:block>
<xsl:if test="*">
<fo:block xsl:use-attribute-sets="sectionTable" >
<fo:block xsl:use-attribute-sets="h2ID"><xsl:value-of select="local:tagName(.)"/></fo:block>
<fo:table table-layout="fixed" space-after="12pt" width="100%" font-size="10pt"
border-bottom="1pt solid #000" border-top="1pt solid #000"
border-left="1pt solid #000" border-right="1pt solid #000" text-align="left"
border-after-width.length="1pt" border-after-width.conditionality="retain"
border-before-width.length="1pt" border-before-width.conditionality="retain">

<fo:table-column column-number="1" column-width="1.25in" border-right="1pt solid #000"/>
<fo:table-column column-number="2" column-width="2.75in"/>
<fo:table-column column-number="3" column-width="1.3in"/>
<fo:table-column column-number="4" column-width="2.1in"/>

<fo:table-body start-indent="0in">
<xsl:if test="child::*[@level][1][@level='item' or @level='file' or @level='otherlevel']">
<xsl:call-template name="tableHeaders"/>
</xsl:if>
<xsl:apply-templates select="*[not(self::ead:head)]"/>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:if>
</xsl:template>

<!--
Expand Down

0 comments on commit 381f849

Please sign in to comment.