473,569 Members | 3,043 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XSL:FO Table of content aligning page numbe to right margin???

Hello people,

I'm having a hard time figuring out how to align my page numbe properly
to the right margin in the Table of content I'm generating. I'm using
FOP and there are some known issues regarding inline/inline-containers
that use the text-align="justify" attribute value. It seems to plain
not work at all in my case. I tried many things and I would like to
avoid mustering esoteric alignments manually. Here is a snippet of what
I'm trying to fix.

The loop simply iterates on the nodes, outputs a titletext and a
fetches the page number where the corresponding section/subsection or
subsubsection is situated in the document. The code works fine, I just
want to be able to align the page number right. I also need to generate
dots between the title and the page number like so:

1. SECTION 1 . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . . . . . . . 8
2. SECTIONBLAHBLAH . . . . . . . . . . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . . 18

Here is the snippet:

<fo:list-block>
<xsl:for-each select="//Body-SB/*">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>
<xsl:number count="child::* " format="1."/>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block text-align="justify" >
<xsl:value-of select="@titlet ext" />
<fo:page-number-citation ref-id="page.{name( )}"
line-height="0" />
</fo:block>
<fo:block>
<xsl:call-template name="Table Of Content Subsections"/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:for-each>
</fo:list-block>
</xsl:template>

<xsl:template name="Table Of Content Subsections">
<fo:list-block>
<xsl:for-each select="./*">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>
<xsl:number count="child::* " format="A."/>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:value-of select="@titlet ext" />
<fo:page-number-citation ref-id="page.{name( )}"
line-height="0" />
<xsl:call-template name="Table Of Content
Subsubsections"/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:for-each>
</fo:list-block>
</xsl:template>

<xsl:template name="Table Of Content Subsubsections" >
<xsl:if test="name()='P-Eff' or name()='P-Refs' or
name()='M-Parts'">
<fo:list-block>
<xsl:for-each select="./*">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>
<xsl:number count="child::* " format="1."/>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:value-of select="@titlet ext" />
<fo:page-number-citation ref-id="page.{name( )}"
line-height="0" />
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:for-each>
</fo:list-block>
</xsl:if>
</xsl:template>

How should I go about doing this? Any thoughts?

Thanks
Jean-Francois Michaud

Apr 21 '06 #1
0 1945

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2148
by: Philip Meyer | last post by:
1) setting image as Background with alignment in center not working..help Explanation : i need to set a image as background and also it should be dispalyed in the center.i am using apache fop 0.25 Problem : i am using apache fop 0.25 and i used the below to set a gif as background and alignment to be center...
4
2724
by: David | last post by:
Hello list, I'm using XML + XSL + CSS to display my data to the web. I also want to publish my pages in PDF format. To accomplish this I first must transform my XML + XSL + CSS in XSL-FO. Is there a know technique to transform my data to XSL-FO without loosing my markup. For example, transformation my data to XHTML first and later from...
4
5308
by: hilz | last post by:
Hi all: Is there a way to make the <fo:page-number> start from a value different than 1 ? (using fop to generate pdf) thanks hilz
0
3940
by: Rary | last post by:
I am using XSL:FO to generate PDF report for my XML, generating it in tables, i want that tables should completely be at one place, if there is a page break , all the contents of the table should move to the next page. can any one suggest a way out? This is my code (number 18, Brunelli Rocco, should move to the next page): XML: <?xml...
0
2416
by: Nathan | last post by:
Hi, I seem to having a peculiar problem with the display of odd and even pages in XSL-FO. Here is a small background of the problem. My xsl stylesheet mentions my fo:layout-master-set as <fo:layout-master-set> <fo:simple-page-master margin-left="0.5in" margin-right="0.5in" page-width="8.5in" margin-bottom="0.5in"...
6
1373
by: Jean-François Michaud | last post by:
Hello, I'm having trouble figuring something out. I have to reproduce a PDF output and in the original document, "revision indicators" are used to show which parts of the document have changed since last version. This revision indicator simply looks like a border to the left of the page, but is always located at the same distance from the...
0
2484
by: jklBruin | last post by:
i'm trying to implement converting xsl-fo to pdf on a .Net page. i''m getting the error message: Root element must be root, not http://www.w3.org/1999/XSL/Transform:stylesheet here's the xsl i'm using. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet
0
1136
by: Matthias | last post by:
Hi all, I have a problem with XSL FO. I wrote a handbook for my application in XML and formats it with xsl:fo (FOP) for PDF output. The handbook has some chapters. I have to write the actual chapter heading (e.g. Handbook - Chapter 1 HEADING_OF_CHAPTER_ONE) into the header or footer to follow our styleguide. I use a template for the header...
1
3407
by: jamesm6162 | last post by:
Hi I have the following XSL-FO document that I'm testing with the FOP processor. The table I put in, however, is completely stuck to the left side of the body-region, regardless of which margins or paddings I insert. How do I indent the whole table? This is extremely frustrating. Thanks <fo:flow flow-name="xsl-region-body">...
1
5316
by: cleary1981 | last post by:
Hi, I am trying to add page numbers to my document in xsl fo. I can get the page numbers to work but I need them to show at the bottom of each page. I know you can define an area as region-after but don't know how. Heres my xsl file so far. <?xml version="1.0" encoding="ISO-8859-1" ?> <xsl:stylesheet version="1.0" ...
0
7930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.