Ordered list letters instead of numbers for specific instances

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

Ordered list letters instead of numbers for specific instances

Post by josecotes »

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: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Ordered list letters instead of numbers for specific instances

Post by Radu »

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: 23
Joined: Wed Nov 18, 2015 6:43 pm

Re: Ordered list letters instead of numbers for specific instances

Post by josecotes »

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