Ticket #514 (closed question: fixed)

Opened 4 years ago

Last modified 3 years ago

Numbering with XSLT?

Reported by: cmueller Owned by: vzholudev
Priority: major Milestone:
Component: XSLT Version: v0.1.3
Keywords: Cc: kohlhase, clange
Blocked By: Blocking:
Due to close: Include in GanttChart: no
Dependencies: Due to assign:

Description

How can I initiate that sections are numbered in ascending order?

<tgroup layout="section">
  <metadata>
    <dc:title>Intro</dc:title>
  </metadata>
</tgroup>
<tgroup layout="section">
  <metadata>
    <dc:title>Main</dc:title>
  </metadata>
</tgroup>
<tgroup layout="section">
  <metadata>
    <dc:title>Outlook</dc:title>
  </metadata>
</tgroup>

Currently our XSLT return the following:

1. Intro
1. Main
1. Outlook

How can I initiate the below output with XSLT?

1. Intro
2. Main
3. Outlook

Change History

follow-up: ↓ 2   Changed 4 years ago by clange

With your input as given above, I get the following behavior:

  • using it as you pasted it here: no numbering at all
  • changing "section" to "sectioning": numbering as desired: 1, 2, 3.

What exact input did you use?

in reply to: ↑ 1   Changed 4 years ago by cmueller

Replying to clange:

What exact input did you use?

I used "section" instead of "sectioning". I just changed my test data as follows:

<omdoc>
<theory>
<tgroup layout="sectioning">
  <metadata>
    <dc:title>Intro</dc:title>
  </metadata>
</tgroup>
<tgroup layout="sectioning">
  <metadata>
    <dc:title>Main</dc:title>
  </metadata>
</tgroup>
<tgroup layout="sectioning">
  <metadata>
    <dc:title>Outlook</dc:title>
  </metadata>
</tgroup>
</theory>
</omdoc>

which results in

1.1. Intro
1.2. Main
1.3. Outlook

But I just realised that when using theory elements instead of tgroup elements, I get the numbering I was looking for:

<omdoc>
<theory>
  <metadata>
    <dc:title>Intro</dc:title>
  </metadata>
</theory>
<theory>
  <metadata>
    <dc:title>Main</dc:title>
  </metadata>
</theory>
<theory>
  <metadata>
    <dc:title>Outlook</dc:title>
  </metadata>
</theory>
</omdoc>

results in

1. Intro
2. Main
3. Outlook

Many thanks for your help!

  Changed 3 years ago by nmueller

  • owner changed from nmueller to vzholudev

  Changed 3 years ago by clange

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.