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

Targeting nodes between <lb/> elements

Subject: Targeting nodes between <lb/> elements
From: xsl-list@xxxxxxxxxxxx
Date: Sun, 27 Apr 2008 23:45:26 -0400
 Targeting nodes between <lb/> elements
Hello all,

I've been lurking for a while, and would like first to express my thanks to all of the experts here who are so incredibly generous with their expertise.

I've been banging my head (painfully) against what seems to me should be a relatively simple issue. I've tried to find the solution in the obvious books and in the archives of this list, but at this point am completely demoralised by repeated failure. I'd be extremely grateful for any help in getting past this hurdle.

I'm trying to wrap in an <fo:block> the nodes between pairs of <lb/> elements. These nodes are not all siblings:

[source]
<lb/><sp><speaker>speaker1</speaker><p>text1
<lb/>text2</p></sp>
<lb/><sp><speaker>speaker2</speaker><p>text3
<lb/>text4</p></sp>

[desired output]
<fo:block><fo:inline>speaker1</fo:inline>text1</fo:block>
<fo:block>text2</fo:block>
<fo:block><fo:inline>speaker2</fo:inline>text3</fo:block>
<fo:block>text4</fo:block>

Also, I need to be able to further process some elements in each matched sequence (such as the <speaker> shown in the example). None of these elements will contain <lb/>.

Using XSLT 2.0 and Saxon 9B (and XEP), I've tried countless approaches involving for-each-group or simple XPath predicates ( << and >> ). Problems have ranged from matching problems to looping problems (Saxon error: "Too many nested apply-templates calls. The stylesheet may be looping.").

Many thanks in advance for any help you can send my way. At this point I'm fully prepared to be mortified by the inevitable simplicity of the solution...

Kitto

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.