Skip to content

Commit

Permalink
Gerrit found a better solution (one that works, even)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndw committed Jul 2, 2022
1 parent e32ebe7 commit 60a9e99
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/xslt/modules/functions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@
<xsl:sequence select="1"/>
</xsl:when>
<xsl:otherwise>
<!-- Hat tip to Gerrit for the fix here -->
<xsl:variable name="plist"
select="$list/preceding::db:orderedlist
[not(ancestor::db:orderedlist)][1]"/>
select="$list/ancestor-or-self::*[preceding-sibling::db:orderedlist][1]
/preceding-sibling::db:orderedlist[1]"/>

<xsl:sequence select="f:orderedlist-startingnumber($plist)
+ count($plist/db:listitem)"/>
Expand Down
16 changes: 16 additions & 0 deletions src/test/resources/xml/orderedlist.004.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,20 @@
<para>Fourth Item</para>
</listitem>
</orderedlist>

<para>What about this one (hat tip to Gerrit Imsieke).</para>

<orderedlist>
<listitem><para>First item</para></listitem>
<listitem><para>Second item</para>
<orderedlist>
<listitem><para>Item 2.a</para></listitem>
</orderedlist>
<para>Interstitial paragraph.</para>
<orderedlist continuation="continues">
<listitem><para>Item 2.b</para></listitem>
</orderedlist>
</listitem>
</orderedlist>
</article>

0 comments on commit 60a9e99

Please sign in to comment.