[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1164
  • Last Modified:

xslt-fo - how do I indent second line of an index entry?

When I use <xsl:value-of select="$currentTerm"/> and the text string is long, I get some thing like:

asdfasdf sadfasdf asdfasdf asdfasdf
asdf 1-2

What I want is the second line indented like:

asdfasdf sadfasdf asdfasdf asdfasdf
    asdf 1-2

How can I accomplish this?
0
aeijohn
Asked:
aeijohn
  • 3
  • 2
1 Solution
 
WerrockCommented:
Add <div style="padding-left: 20px; text-indent: -20px;"> and </div> around it.
0
 
kmartin7Commented:
Hi aeijohn,

We had to cheat by creating a series of list items, and indenting and outdenting to get the desired effect. Take a look at the attached PNG to see the result. Here is a snippet of how we handle it.

This is for a table of contents, and to get an entire word to break properly, we append a series of periods to make a whole word (notice text "wrap around sometime......"). It is a kluge but works.

The indentation is nothing more than a combination of outdenting and indenting. Notice the following attributesL

text-indent="-.125in" end-indent=".5in" last-line-end-indent="-.5in"

HTH,

kmartin7
<fo:list-item start-indent="0in">
	<fo:list-item-label end-indent="label-end()">
		<fo:block font-family="Arial" font-size="10pt" font-weight="normal" text-align="left">
			<fo:inline>Table A-22</fo:inline>
		</fo:block>
	</fo:list-item-label>
	<fo:list-item-body start-indent="1.125in">
		<fo:block font-family="Arial" font-size="10pt" keep-together.within-page="always" text-align-last="justify" text-indent="-.125in" end-indent=".5in" last-line-end-indent="-.5in">
			<fo:inline>Power Distribution Assembly to Reader Motor Cable Assembly Wire List this is a very very very long title and it must wrap around sometime......</fo:inline>
			<fo:leader leader-pattern="dots" keep-with-previous.within-line="always"/>
			<fo:inline padding-start="1pt" wrap-option="no-wrap" keep-together.within-line="always" keep-with-previous.within-line="always">A-<fo:page-number-citation ref-id="tQ3318565"/></fo:inline>
		</fo:block>
	</fo:list-item-body>
</fo:list-item>

Open in new window

0
 
kmartin7Commented:
Oops, I forgot to attach the PNG, so here it is...
indented-index.png
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
aeijohnAuthor Commented:
Actually I added the padding-left: 20px; text-indent: -20px; to  tag no matter where I placed it.
But your answer got me to where I wanted so I am accepting this as the solution.

Thank you
0
 
kmartin7Commented:
Wow. Your title is specific to XSL:FO. Does Werrock's solution work for XSL:FO?
0
 
aeijohnAuthor Commented:
Well, yes and no. The <div> tag was not welcomed and caused errors every where I tried to use it. But Werrock's solution put me on the path of using text-ident with a negitive value and then shifting the left margin over to compensate for it. This worked very well and I was able to get the index output as I wanted.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now