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?
Who is Participating?
WerrockConnect With a Mentor Commented:
Add <div style="padding-left: 20px; text-indent: -20px;"> and </div> around it.
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"


<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: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>

Open in new window

Oops, I forgot to attach the PNG, so here it is...
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

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
Wow. Your title is specific to XSL:FO. Does Werrock's solution work for XSL:FO?
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.