|
Rank: Newbie
Joined: 8/10/2017 Posts: 1 Location: United States
|
Hello,
I am having an issue formatting list numbers for an XML to PDF conversion and was hoping someone might be able to provide some insight. Due to constraints of previously released publications, I am locked in to a specific numbering format: 1.A(1)a_1._ _a._
I have been unable to find a solution for my transform that will allow me to have both the correct format and the correct numbering (I seem to only be able to get one or the other).
The input is:
Code: <ol> <li><para>Para 01</para></li> <li><para>Para 02</para> <ol> <li><para>Para 02a</para></li> <li><para>Para 02b-1</para> <para>Para 02b-2</para> </li> </ol> </li> <li><para>Para 03</para> <ol> <li><para>Para 03a-1</para> <para>Para 03a-2</para> </li> <li><para>Para 03b</para></li> </ol> </li> <li><para>Para 04</para></li> </ol>
and the desired output is:Code: 1. Para 01 2. Para 02 A. Para 02a B. Para 02b-1 Para 02b-2 3. Para 03 A. Para 03a-1 Para 03a-2 B. Para 03b
My first solution was to use insert->bullets and numbering. The counters reset appropriately. However, the built-in numbering formats don't allow me to customize the formats to the level I need.
My second solution was to try and use the TOC and sequential numbering. The sequential numbering allowed me to create the formats I needed. However, I was unable to get the counters to reset properly.
My third solution was to use XPATH to count the nodes. The xpath [ count(preceding-sibling::xhtml:li)+1 ] counts the nodes properly. However, it does not allow me to format the numbering.
XSLT has the ability to change the number format. However, I have been unable to figure out how to write/integrate an xslt just to handle the list items.
Any thoughts would be greatly appreciated.
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
Quick question regarding your third solution: why do you say that XPath doesn't allow you to format? With format-integer function you should be able to achieve what you want.
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
Now, I've tried to implement your task, and everything went as expected without any tricks.
The following design screenshot gives me HTML output screenshot vlad attached the following image(s):
|
|
guest |