openstax / oer.exports

Converter to various book formats (PDF, epub, mobi)
2 stars 0 forks source link

Call IdCheck in the newly created element #4073

Open aiwenar opened 3 years ago

aiwenar commented 3 years ago

When an ID was specified on a <db:tgroup> the Docbook to HTML conversion would fail with

xsl:attribute: Cannot add attributes to an element if children have been already added to the element.

Assuming I understand XSLT correctly, this is because <xsl:call-template name="IdCheck"/> call was being made directly in <xsl:template match="db:tgroup"> rather than in the element it constructed, causing the xsl:attribute call in IdCheck to try to add the attribute to the original db:tgroup rather than to the new colgroup.