Page 1 of 1

Ordered list letters instead of numbers for specific instances

Posted: Thu Apr 20, 2017 10:13 pm
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,

Re: Ordered list letters instead of numbers for specific instances

Posted: Fri Apr 21, 2017 8:12 am
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

Re: Ordered list letters instead of numbers for specific instances

Posted: Fri Apr 21, 2017 3:35 pm
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>