Hi Peter,
Yes, this is a bug. The DocBook schema allows an indexterm element
between glossterm and glossdef, but those map to dt and dd,
respectively, and they don't allow anything in between. The updated
template (attached) puts the indexterm in the dt element. I'll check
this change into the SVN repo for the next release.
Bob Stayton
Sagehill Enterprises
[email protected]
On 7/30/2014 4:04 PM, Peter Lavin wrote:
HI,
I'm attempting to validate an EPUB 3 file that contains a glossary and
I'm seeing the following error for each glossary entry:
ERROR: book.epub/OEBPS/db.gloss.xhtml(22,48): element "a" not allowed
here; expected element "dd" or "dt"
I'm using Epubcheck Version 3.0.1 and my style sheets are 1.78.1
(docbook-xsl-ns).
An example of the HTML that raises the error follows:
<dl>
<dt id="db.gloss.json"><span class="glossterm" epub:type="glossterm"/>
(<abbr class="acronym">JSON</abbr>)</dt>
<a id="idp1493040" class="indexterm"/>
<dd class="glossdef" epub:type="glossdef">
<p/>
</dd>
...
</dl>
Attempting to validate this HTML at the W3C site throws the following error:
Line 22, Column 46: XHTML element a not allowed as child of XHTML
element dl in this context. (Suppressing further errors from this subtree.)
<a id="idp1493040" class="indexterm"/>
Am I correct in assuming that this style sheet generates invalid HTML?
If so, how can this be fixed?
Thanks.
--
Peter Lavin
Skype: peter.lavin
(GMT -05:00 Canada/US Eastern)
<xsl:template match="d:glossentry">
<xsl:choose>
<xsl:when test="$glossentry.show.acronym = 'primary'">
<dt>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="d:acronym|d:abbrev">
<xsl:apply-templates select="d:acronym|d:abbrev"/>
<xsl:text> (</xsl:text>
<xsl:apply-templates select="d:glossterm"/>
<xsl:text>)</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="d:glossterm"/>
</xsl:otherwise>
</xsl:choose>
</dt>
</xsl:when>
<xsl:when test="$glossentry.show.acronym = 'yes'">
<dt>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="d:glossterm"/>
<xsl:if test="d:acronym|d:abbrev">
<xsl:text> (</xsl:text>
<xsl:apply-templates select="d:acronym|d:abbrev"/>
<xsl:text>)</xsl:text>
</xsl:if>
<xsl:apply-templates select="d:indexterm"/>
</dt>
</xsl:when>
<xsl:otherwise>
<dt>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="d:glossterm"/>
<xsl:apply-templates select="d:indexterm"/>
</dt>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="d:glosssee|d:glossdef"/>
</xsl:template>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]