[xsl] Splitting XHTML by elements that have page-breaks

Subject: [xsl] Splitting XHTML by elements that have page-breaks
From: Martynas Jusevicius <martynas.jusevicius@xxxxxxxxx>
Date: Wed, 16 Sep 2009 01:24:13 +0200
Hey list,

I asked recently how to split a big XHTML file into several chunks
(under 300 KB) for use in ePub. I have that problem semi-solved -- I
decided to go the easier route and split the file into chapters, and
the chunks turned out to be well less than 300 KB, so I'll stick to
that so far.

I used sibling recursion on html:h1 elements, and that worked fine.
But now I need not only headings to be used for splitting, but many
more elements, e.g. html:p[@class = 'Quote'] -- actually all those
that have page-breaks defined in their styles.

The styles are defined in a separate style.xml file which comes from
ODT. Style names become CSS classnames in XHTML, so I can check by
@class value if a style has a page-break:
document('styles.xml')//style:style[@style:name =
'Quote']/style:paragraph-properties/@fo:break-before = 'page'

And here comes the question -- how can I define sibling recursion not
only on html:h1, but on html:* that have page-breaks? I hope it's
possible to understand..

Thanks,

Martynas
semantic-web.dk

Current Thread