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

Creating hierarchies from in-line markers

Subject: Creating hierarchies from in-line markers
From: "Peter West lists@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 28 Jun 2014 03:44:15 -0000
 Creating hierarchies from in-line markers
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?


Peter West

"...for I am gentle and lowly in heart, and you will find rest for your
souls."

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.