Closed ailie-s closed 2 years ago
Potential fix for tagLibrary2pdf.xsl below. The same does not work for tagLibrary2html.xsl.
<xsl:template
match="eac-cpf:* | eac:* |example:* | ead:* | ead3:* | mods:* | text:* | dc:* | oai_dc:* | premis:*">
<xsl:variable name="myDepth"
select="count(ancestor::*[not(namespace-uri() = 'http://www.tei-c.org/ns/1.0')]) * 5"/>
<fo:block start-indent="body-start() + {$myDepth}mm" wrap-option="wrap">
<xsl:call-template name="newLine"/>
<xsl:text><</xsl:text>
<xsl:value-of select="local-name()"/>
<xsl:for-each select="@*">
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when
test="namespace-uri() = 'http://workaround for xml namespace restriction/namespace'">
<xsl:text>xml:</xsl:text>
<xsl:value-of select="local-name()"/>
</xsl:when>
<xsl:when test="namespace-uri() = 'http://www.w3c.org/1999/xlink'">
<xsl:text>xlink:</xsl:text>
<xsl:value-of select="local-name()"/>
</xsl:when>
<xsl:when test="local-name() = 'schemaLocation'">
<xsl:text>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" </xsl:text>
<xsl:text>xsi:schemaLocation</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="local-name()"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>="</xsl:text>
<xsl:value-of select="."/>
<xsl:text>"</xsl:text>
</xsl:for-each>
<xsl:choose>
<xsl:when test="exists(text())">
<xsl:text>></xsl:text>
<xsl:apply-templates select="* | text()"/>
<fo:inline keep-together.within-line="always" keep-with-previous.within-line="always">
<xsl:text></</xsl:text>
<xsl:value-of select="local-name()"/>
<xsl:text>></xsl:text>
</fo:inline>
</xsl:when>
<xsl:otherwise>
<xsl:text>/></xsl:text>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</xsl:template>
Resolved in #92 - thanks @ailie-s !
When empty elements are used in examples in the tag library, closing tags are being added in the transformations to both HTML and PDF versions.
Creator of issue
The issue relates to
Wanted change/feature
Reporting a bug
For example, in EAC:
<entityType value="person"/>
is displaying as:
<entityType value="person"></entityType>
As
<entityType>
cannot have any content in EAC-CPF v2.0, it would be preferable if it was displayed as<entityType value="person"/>
in the tag libraries.Suggested Solution
Steps to Reproduce (for bugs)
<entityType>
in https://github.com/ailie-s/EAS-TagLibraries/blob/master/tei/eac.pdf, https://github.com/ailie-s/EAS-TagLibraries/blob/master/html/eac.html and https://github.com/ailie-s/EAS-TagLibraries/blob/master/tei/EAC-CPF-v2-TL-eng.xmlContext
Your Environment can be a clue to a bug