[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

pagebreak between elements

Subject: pagebreak between elements
From: jelmer <jkuperus@xxxxxxxxx>
Date: Thu, 21 Aug 2003 01:50:51 +0200
xsl pagebreak
Hi , I am currently writing some html coversion xsl sheets for a TEI based
dialect
the layout should basicly look like this


<table>
    <tr>
        <td>
            page1 text
        </td>
        <td>
            footnotes page 1
        </td>
    </tr>
    <tr>
        <td>
            page 2 text
        </td>
        <td>
            footnotes page 2
        </td>
    </tr>
</table>


the problem is that TEI uses  <pb /> (pagebreak) elements to seperate pages
instead of heving something like

<page>
    yadayada
</page>

this brings a problem

linebreaks can occur in lists , blockquotes etc

this means i close the tr tag on the pb element when a blockquote witch is
matched by another template is
still open, resulting in faulty html like this :

      <tr>
        <blockquote>
          part1
          </tr>
          part2
        </blockquote>
        <tr>

while i need this :

      <tr>
        <blockquote>
        part 1
        </blockquote>
      </tr>
      <tr>
        <blockquote>
        part 2
        </blockquote>
      </tr>

the way this is solved right now is that we check for the ancestor and then
close it
with

<xsl:when test="ancestor::blockquote">
  <xsl:text disable-output-escaping="yes"><![CDATA[
</blockquote>]]></xsl:text>
</xsl:when>

then close the tr, open another tr and then reopen the tag like this

<xsl:when test="ancestor::blockquote">
  <xsl:text disable-output-escaping="yes"><![CDATA[
<blockquote>]]></xsl:text>
</xsl:when>


IMHO Is is a quite distastefull solution as it increases the chances of
nonvalid output, and you basicly have 3 blockquote templates

if for instance i where to change

<xsl:template match="bq">
    <blockquote>
        <xsl:apply-templates />
    </blockquote>
</xsl:template>

to

<xsl:template match="bq">
    <div class="bq">
        <xsl:apply-templates />
    </div>
</xsl:template>

i'd also have to change the pb template on 2 locations


I imagine this is a fairly common problem and I find it hard to believe that
this would be the best solution available
but looking on the web I couldn't turn up anything
Can anyone offer a cleaner solution ? or is this really the way it should be
done

thanks in advance

-- jelmer


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.