<ul>/<ol> lists configuration

Here should go questions about transforming XML with XSLT and FOP.
yiyi_vivi
Posts: 13
Joined: Tue Nov 13, 2012 9:30 pm

<ul>/<ol> lists configuration

Post by yiyi_vivi »

I want to increase the space between the list number and the list content, and also I want to make the list number normal, not in bold.

I almost modified every number in list-attr.xsl, but nothing happened.

Code: Select all

<!--Ordered list-->
<xsl:attribute-set name="ol" use-attribute-sets="common.block">
<xsl:attribute name="provisional-distance-between-starts">50mm</xsl:attribute>
<xsl:attribute name="provisional-label-separation">1mm</xsl:attribute>
<xsl:attribute name="margin-left">36pt</xsl:attribute>
</xsl:attribute-set>

<xsl:attribute-set name="ol.li">
<xsl:attribute name="space-after">1.5pt</xsl:attribute>
<xsl:attribute name="space-before">36pt</xsl:attribute>
</xsl:attribute-set>

<xsl:attribute-set name="ol.li__label">
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
<xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
<xsl:attribute name="end-indent">label-end()</xsl:attribute>
</xsl:attribute-set>

<xsl:attribute-set name="ol.li__label__content">
<xsl:attribute name="text-align">start</xsl:attribute>
<!-- <xsl:attribute name="font-weight">bold</xsl:attribute> -->
</xsl:attribute-set>

<xsl:attribute-set name="ol.li__body">
<xsl:attribute name="start-indent">body-start()</xsl:attribute>
</xsl:attribute-set>

<xsl:attribute-set name="ol.li__content">
</xsl:attribute-set>
Any help appreciate.

Thanks,
Ivy
yiyi_vivi
Posts: 13
Joined: Tue Nov 13, 2012 9:30 pm

Re: <ul>/<ol> lists configuration

Post by yiyi_vivi »

Oh, actually I made the changes in common-attr-custom.xsl, it works.

But is it supposed to work if I made changes in lists-attr-custom.xsl?

Thanks,
Ivy
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: <ul>/<ol> lists configuration

Post by sorin_ristache »

Hello,

For a customization in the DITA PDF output usually you create a new XSLT stylesheet with your customized attribute values, named for example common-attr-custom.xsl, which you import in the transformation by specifying it in the [Oxygen-install-dir]/frameworks/dita/DITA-OT/plugins/org.dita.pdf2/cfg/catalog.xml file. For example if the catalog.xml file says:

Code: Select all

  <uri name="cfg:fo/attrs/custom.xsl" uri="fo/attrs/custom.xsl"></uri>
then you should import your custom stylesheet in fo/attrs/custom.xsl:

Code: Select all

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version="2.0">

<xsl:import href="common-attr-custom.xsl"/>

</xsl:stylesheet>

Regards,
Sorin
yiyi_vivi
Posts: 13
Joined: Tue Nov 13, 2012 9:30 pm

Re: <ul>/<ol> lists configuration

Post by yiyi_vivi »

Hi Sorin,

Thanks a lot. What you said is what I did. And my question at this point is: Can I create a new XSLT stylesheet for lists only, named lists-attr-cumstom.xsl, and import this customized stylesheet in fo/attrs/custom.xsl? I think this should be work also. However it didn't.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: <ul>/<ol> lists configuration

Post by sorin_ristache »

Hi,

Yes, it works if the FO processor applies correctly the attributes which you set in lists-attr-custom.xsl. The problem is that the Apache FOP processor seems to not apply always correctly the attribute provisional-label-separation, but if I set both provisional-distance-between-starts and provisional-label-separation attributes they are applied. For example if you set XEP instead of Apache FOP on the FO Processor tab then these attributes are applied correctly in the PDF output.

For example are these 2 attributes applied correctly on your computer when Apache FOP is used (the default FO processor in the DITA PDF transform) if you have the following in lists-attr-custom.xsl?

Code: Select all

    <xsl:attribute-set name="ol" use-attribute-sets="common.block">
<xsl:attribute name="provisional-distance-between-starts">15mm</xsl:attribute>
<xsl:attribute name="provisional-label-separation">15mm</xsl:attribute>
</xsl:attribute-set>
If not, you may send us a zip archive with your customization files (please send the entire directory [Oxygen-install-dir]/frameworks/dita/DITA-OT/plugins/org.dita.pdf2/cfg) and we will look at it.


Regards,
Sorin
Post Reply