Skip to content

Commit

Permalink
An attempt at #640 fixing:
Browse files Browse the repository at this point in the history
 * template showAttClasses is called from 6 different places (all in common_tagdocs);
 * generated debugging code for each of those places;
 * found which 2 were causing problem (li element as child of td instead of child of ul);
 * wrapped them in ul element.
 * Note: deliberately left debugging PIs in place, but they should maybe be removed before merging into dev.
  • Loading branch information
sydb committed Oct 28, 2023
1 parent a3b252c commit 12c7bf2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
36 changes: 21 additions & 15 deletions common/common_tagdocs.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,11 @@
</xsl:attribute>
<xsl:choose>
<xsl:when test="not(tei:attList)">
<xsl:call-template name="showAttClasses"/>
<xsl:element namespace="{$outputNS}" name="{$ulName}">
<xsl:attribute name="{$rendName}" select="'attList'"/>
<xsl:processing-instruction name="DEBUG"> calling showAttClasses 01 </xsl:processing-instruction>
<xsl:call-template name="showAttClasses"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="tei:attList">
Expand Down Expand Up @@ -708,6 +712,7 @@
<a>
<xsl:choose>
<xsl:when test="not(tei:attList)">
<xsl:processing-instruction name="DEBUG"> calling showAttClasses 02 </xsl:processing-instruction>
<xsl:call-template name="showAttClasses"/>
</xsl:when>
<xsl:otherwise>
Expand Down Expand Up @@ -742,7 +747,11 @@
</xsl:attribute>
<xsl:choose>
<xsl:when test="not(tei:attList)">
<xsl:call-template name="showAttClasses"/>
<xsl:element namespace="{$outputNS}" name="{$ulName}">
<xsl:attribute name="{$rendName}" select="'attList'"/>
<xsl:processing-instruction name="DEBUG"> calling showAttClasses 03 </xsl:processing-instruction>
<xsl:call-template name="showAttClasses"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="tei:attList">
Expand All @@ -756,7 +765,7 @@
<xsl:for-each select="$myatts/a">
<xsl:copy-of select="*|text()"/>
</xsl:for-each>
-->
-->
</xsl:element>
</xsl:element>
</xsl:if>
Expand Down Expand Up @@ -1153,6 +1162,7 @@
<xsl:attribute name="{$colspan}">
<xsl:text>2</xsl:text>
</xsl:attribute>
<xsl:processing-instruction name="DEBUG"> calling showAttClasses 04 </xsl:processing-instruction>
<xsl:call-template name="showAttClasses">
<xsl:with-param name="minimal">true</xsl:with-param>
</xsl:call-template>
Expand Down Expand Up @@ -1186,6 +1196,7 @@
/>
</xsl:element>
</xsl:if>
<xsl:processing-instruction name="DEBUG"> calling showAttClasses 05 </xsl:processing-instruction>
<xsl:call-template name="showAttClasses">
<xsl:with-param name="minimal">true</xsl:with-param>
</xsl:call-template>
Expand Down Expand Up @@ -2125,6 +2136,7 @@
<xsl:template name="displayAttList">
<xsl:param name="mode"/>
<xsl:variable name="attribute_list_items">
<xsl:processing-instruction name="DEBUG"> calling showAttClasses 06 </xsl:processing-instruction>
<xsl:call-template name="showAttClasses"/>
<xsl:if test=".//tei:attRef">
<xsl:call-template name="showAttRefs"/>
Expand Down Expand Up @@ -2739,8 +2751,7 @@
<xsl:template name="showAttClasses">
<xsl:param name="minimal">false</xsl:param>
<xsl:variable name="clatts">
<xsl:for-each
select="ancestor-or-self::tei:elementSpec | ancestor-or-self::tei:classSpec">
<xsl:for-each select="ancestor-or-self::tei:elementSpec | ancestor-or-self::tei:classSpec">
<xsl:call-template name="attClassDetails"/>
</xsl:for-each>
</xsl:variable>
Expand All @@ -2754,12 +2765,9 @@
<xsl:if test="ancestor::tei:schemaSpec and key('CLASSES', 'att.global')">
<xsl:variable name="word">
<xsl:choose>
<!-- Per issue 515, the word "Attributes" need not be output here. -->
<xsl:when test="not($autoGlobal = 'true')"><!--Attributes--></xsl:when>
<xsl:when test=".//tei:attDef">In addition to global attributes
and those inherited from</xsl:when>
<xsl:otherwise>Global attributes and those inherited
from</xsl:otherwise>
<xsl:when test="not($autoGlobal = 'true')"/>
<xsl:when test=".//tei:attDef">In addition to global attributes and those inherited from</xsl:when>
<xsl:otherwise>Global attributes and those inherited from</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="normalize-space($word) ne ''">
Expand All @@ -2777,10 +2785,8 @@
<xsl:otherwise>
<xsl:variable name="word">
<xsl:choose>
<!-- Per issue 515, the word "Attributes" need not be output here. -->
<xsl:when test="not($autoGlobal = 'true')"><!--Attributes--></xsl:when>
<xsl:when test=".//tei:attDef">In addition to global
attributes</xsl:when>
<xsl:when test="not($autoGlobal = 'true')"/>
<xsl:when test=".//tei:attDef">In addition to global attributes</xsl:when>
<xsl:otherwise>Global attributes only</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Expand Down
1 change: 1 addition & 0 deletions epub3/tei-to-epub3.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
xpath-default-namespace="http://www.tei-c.org/ns/1.0"
>
<xsl:import href="../html/html.xsl"/>
<xsl:import href="../odds/classatts.xsl"/>
<xsl:import href="../epub/epub-common.xsl"/>
<xsl:import href="../epub/epub-preflight.xsl"/>
<xsl:output method="xml" encoding="utf-8" doctype-system=""
Expand Down

0 comments on commit 12c7bf2

Please sign in to comment.