Subject: Re: [xsl] Creating hierarchies from in-line markers From: "Imsieke, Gerrit, le-tex gerrit.imsieke@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Sat, 28 Jun 2014 05:44:59 -0000 |
I'm sure the subject text is obscurely expressed, which may be why I couldn't find anything appropriate in the archive.
I am looking at epub2 xml in which "structure markers" are interspersed with general content. For instance, new chapters are marked with an H2, and the content of the chapter is on the following-sibling axis, as is the subsequent H2. Similarly, footnotes are marked by DIVs, with the text of the note in one or more P siblings.
In order to make these into hierarchies, I have been using a model like this:
<template match="marker-element[appropriate conditions]"> blah blah blah <apply-templates mode="whatever" select= "following-sibling::node() intersect (following-sibling::marker-element[appropriate conditions] union end-element)[1]/preceding-sibling::node()"/> </template>
and suppressing the "normal" processing of the siblings.
I feel your pain; however, this seems to work. What nicer ways are there of achieving this?
[1] http://www.w3.org/TR/xslt20/#element-for-each-group [2] http://xsl.markmail.org/message/5otmmsaovdpynkew
Peter West
"...for I am gentle and lowly in heart, and you will find rest for your souls."
-- Gerrit Imsieke GeschC$ftsfC<hrer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke@xxxxxxxxx, http://www.le-tex.de
Registergericht / Commercial Register: Amtsgericht Leipzig Registernummer / Registration Number: HRB 24930
GeschC$ftsfC<hrer: Gerrit Imsieke, Svea Jelonek, Thomas Schmidt, Dr. Reinhard VC6ckler
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Creating hierarchies from in-, Peter West lists@xxx | Thread | |
[xsl] Creating hierarchies from in-, Peter West lists@xxx | Date | |
Month |