Forum How do I...?

Combine doc ocntent and generated content in a footer

mark_anderson_us
Hi All

I'm converting an existing XSL to use PrinceXML

The current footer has a block of text on left and the logo on right. I want to center the page number between them, but I can't figure out how to combine the existing footer with generated content

Does anyone have an example?

Regards

Mark
jim_albright
@page {
@bottom-left { contains:"Merry Christmas" /* block of text */ }
@bottom-center { content: counter( page);
/* page number */ }
@bottom-right { /* logo */ }
}


This allows you to put the text where you want it.

If your problem is "How do I split the text?" Here is one way to split it.
<xsl:variable name="left-footer" select="substring-before($footer, 'something-found-between-text-and-logo')"/>
<xsl:variable name="right-footer" select="substring-after($footer, 'something-found-between-text-and-logo'"/>

or look at "split" These questions are better handled at archives
http://www.mulberrytech.com/xsl/xsl-list/

Jim Albright
Wycliffe Bible Translators

mark_anderson_us
Hi Jim

Thanks for reply

I kind of hacked around it using bottom left, center and right

I didn't understand what you were trying to illustrate with the split stuff

I'd still like to be able to do something like (silly example)

<span style="color:red;">"Page"</span>counter(page) " of " <span style="color:red;">counter(pages)</span>;

Regards

Mark
jim_albright
It is not a hack to use bottom left, center and right. That is the accepted way.

Yes you can have different styles located within a footer or in this case right-top.
@right-top
{
content: flow(locator) ;
margin-left: 2em;
text-align: right ;
}


locator4.png


.Locator
{
text-align: center;
flow:static(locator);
}

.Locator > a
{
/* adjust padding to smaller numbers for alphabets containing more characters*/
/* top, right, bottom, left */
padding: 1em 1em 0.5em 1em;
margin: 0 ;
font-weight: normal ;
display:block ;
line-height: 0 ;
font-size: 10pt ;
}

.Current_Letter
{
color: white;
background-color: blue ;
}



<div class="Locator"><a href="#Link_To_1">'</a><a href="#Link_To_2" class="Current_Letter">a</a><a href="#Link_To_3">b</a><a href="#Link_To_4">c</a><a href="#Link_To_5">d</a><a href="#Link_To_6">e</a><a href="#Link_To_7">f</a><a href="#Link_To_8">g</a><a href="#Link_To_9">h</a><a href="#Link_To_10">i</a><a href="#Link_To_11">l</a><a href="#Link_To_12">m</a><a href="#Link_To_13">n</a><a href="#Link_To_14">o</a><a href="#Link_To_15">p</a><a href="#Link_To_16">s</a><a href="#Link_To_17">t</a><a href="#Link_To_18">w</a></div>


Just as the Current_Letter is formatted differently you can format /Page/ differently than /of/ just put it all in a DIV so you place the whole DIV in flow.

Hope this helps you achieve your goal.

Jim Albright
Wycliffe Bible Translators

  1. locator4.png9.2 kB
mark_anderson_us
Thanks Jim

Saw your post about the way you did it whne I searched earlier (nice idea BTW)

That would do it for the simple example I gave. However, my footer contents are in xsl variables so I can't see how the > [string] thing would work. (Knew I should have put in real example) Basically I'd like to be able to get generated content in any html block. If I could get it into an XSL variable it would solve all my problems.

I can live with the left, center, right, but some of our customers want pretty fancy footers. That said, the other benefits of Prince (e.g. not having to learn FO and being able to re-use 99% of existing XSL's) far outweigh this limitation (if that's what it turns out to be)

Regards

Mark
jim_albright
At the top of your XSLT you can add <variable ....> which will be a global variable that you can add to your text.

If this doesn't help I'll need explicit example of what you have and what you want.

Jim Albright
Wycliffe Bible Translators