[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Bible chapter number in heading

Subject: Re: [xsl] Bible chapter number in heading
From: "jim albright jim_albright@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 24 Feb 2016 01:12:08 -0000

Found a solution. The source text had a <chapter> marker at the correct
location that I was ignoring.

-----Original Message-----
From: "Jim Albright jim_albright@xxxxxxxxxxxx"
Sent: b2/b23/b2016 12:55 PM
To: "xsl-list@xxxxxxxxxxxxxxxxxxxxxx" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: [xsl] Bible chapter number in heading

I am producing PDFs for publishing a waterproof Bible using PrinceXML, XSL
version 2.0, and saxon9he.

The top-left of left hand pages should have the book name and chapter
number of the start of the page like:
Matthew 5

I can set the chapter number with
.Chapter_Number {
  	string-set: stringChapterNumber content();

and display with
@page :left {
    @top-left {
	content: string(stringBookName, last) " "
string(stringChapterNumber, start)

When a Section head is the first element on the left hand page, the page
heading says it is the previous chapter number.
This is technically correct but we expect the new chapter number to be
Currently with the following xml the heading is displayed as
Matthew 4 and should be
Matthew 5 when this is the top of the page.

         <p class="Section_Head_Major_Level2">3b. JesC:s yarbirgi dulemar
         <p class="Section_Major_Range_Paragraph">(5:1b7:29)</p>
         <p class="Section_Head">JesC:s Dulegi-bur-nued-binsalegedgi
         <p class="Parallel_Passage">(Lucas 6:20-23)<verseEnd
ID="cuk.MAT.4.25-END" from="cuk.MAT.4.25"/>
            <chapterEnd ID="cuk.MAT.4-END" from="cuk.MAT.4"/>
         <p class="Paragraph">
            <chapterStart id="cuk.MAT.5">5</chapterStart>
            <verseStart id="cuk.MAT.5.1">1</verseStart>JesC:s
dulemar-bukidar ese duurmakdani-dakdegu,

      I have control of the text so I propose adding a new element:
     <span class="next_chapter">5</span>
just before a Section_Head_Majorb&. or Section Head

So far I have

		<xsl:variable name="valueOfNextChapterNumber"

Now I need a conditional that states If the next chapterStart is less than
10 elements below our current position insert
<span class="next_chapter">5</span>
          into the current location before the Section_Headb&b&

And adding the following to the CSS, it should fix the problem.
.next_chapter {
    string-set: stringChapterNumber content();
	display: inline;
	font-size: 0pt;  [hides the text]
[note: display:none; DOES NOT WORK]

Jim Albright
704*562*1529 cell unlimited
JAARS, Speeding Bible Translation
Wycliffe, Partners in Bible Translation

Current Thread