xsl-list
[Top] [All Lists]

[xsl] Bible chapter number in heading

2016-02-23 11:55:06
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)
    }

Problem:
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
shown.
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. Jesús yarbirgi dulemar
odurdaksad</p>
         <p class="Section_Major_Range_Paragraph">(5:1–7:29)</p>
         <p class="Section_Head">Jesús Dulegi-bur-nued-binsalegedgi
sunmaksad</p>
         <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>
         <p class="Paragraph">
            <chapterStart id="cuk.MAT.5">5</chapterStart>
            <verseStart id="cuk.MAT.5.1">1</verseStart>Jesú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_Major…. or Section Head

So far I have
        <xsl:template
match="*[@class='Section_Head_Major_Level2']|*[@class='Section_Head']">

                <xsl:variable name="valueOfNextChapterNumber"
select="following::chapterStart/>

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_Head……


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
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>