Skip to content

Commit

Permalink
ADOC postprocess: when title moves out of info, subtitle needs to mov…
Browse files Browse the repository at this point in the history
…e too

When there was a subtitle in addition to a title of an article, our old
code tended to create this:
- article
  - title
  - info
    - subtitle

However, when title is a direct child of article, subtitle needs to be
too. We now create:
- article
  - title
  - subtitle
  - info
  • Loading branch information
Stefan Knorr committed Jun 8, 2021
1 parent 8f4d286 commit 32f414c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions daps-xslt/asciidoc/postprocess.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,13 @@
</xsl:element>
</xsl:template>

<xsl:template match="d:article/d:info/d:title"/>
<xsl:template match="d:article[d:info/d:title]">
<xsl:template match="d:article/d:info/d:title|d:article/d:info/d:subtitle"/>
<xsl:template match="d:article[d:info/d:title|d:info/d:subtitle]">
<xsl:element name="{local-name(.)}" namespace="&db5ns;">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="d:info/d:title" mode="copy-element"/>
<xsl:apply-templates select="node()"/>
<xsl:apply-templates select="(d:title|d:info/d:title)[1]" mode="copy-element"/>
<xsl:apply-templates select="(d:subtitle|d:info/d:subtitle)[1]" mode="copy-element"/>
<xsl:apply-templates select="node()[not(self::d:title or self::d:subtitle)]"/>
</xsl:element>
</xsl:template>

Expand Down

0 comments on commit 32f414c

Please sign in to comment.