Ordered list letters instead of numbers for specific instances

Here should go questions about transforming XML with XSLT and FOP.
josecotes
Posts: 21
Joined: Wed Nov 18, 2015 6:43 pm

Ordered list letters instead of numbers for specific instances

Post by josecotes » Thu Apr 20, 2017 10:13 pm

Hi all,

This is my xml:

Code: Select all

<topic><title/><body>
<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>
</body></topic>
When I produce a PDF it comes as this:
Image

Now, I need letters instead of numbers for just this particular instance, so I added an outputclass="lower-alpha" to my <ol> tag:

Code: Select all

<topic><title/><body>
<ol outputclass="lower-alpha">
<li>Item 1</li>
<li>Item 2</li>
</ol>
</body></topic>
And then, in my plugin, I added this (see box):
Image

For some reason, this is not working and I am still getting numbers. Any clues?

Thanks all,

Radu
Posts: 6134
Joined: Fri Jul 09, 2004 5:18 pm

Re: Ordered list letters instead of numbers for specific instances

Post by Radu » Fri Apr 21, 2017 8:12 am

Hi,

The XSLT template seems to match the list item element but the @outputclass is set on the OL element. So maybe you should retrieve its value like parent::node()/@outputclass.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

josecotes
Posts: 21
Joined: Wed Nov 18, 2015 6:43 pm

Re: Ordered list letters instead of numbers for specific instances

Post by josecotes » Fri Apr 21, 2017 3:35 pm

Thanks a lot!

This is exactly how I implemented it and it worked:

Code: Select all

<xsl:when test="parent::node()/@outputclass='lower-alpha'">
<xsl:number format="a"/>
</xsl:when>

Post Reply