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

Marked up data with sectbreaks (was Re: XSLT FAQ ideas

Subject: Marked up data with sectbreaks (was Re: XSLT FAQ ideas)
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 17 Feb 2003 18:25:22 -0500
marked up data
At 11:02 AM 2/17/2003, ERH wrote:
I still don't know whether or not my qwuestion was answered in there somewhere. FYI, it was how do you change

marked up data
<sectbreak/>
marked up data
<sectbreak/>
marked up data

into

<sect>
marked up data
</sect>
<sect>
marked up data
</sect>
<sect>
marked up data
</sect>

I did eventually figure it out. (use the count() function in a recursive template to process all the nodes with a certain number of <sectbreak/> before them)

So far's I know that's a new solution or one not seen in public anyhow. The other known solutions are (1) indexing nodes to sectbreaks (generate-id(preceding::sectbreak[1]) works pretty well), then pulling them when matching sectbreaks ... documented somewhat in the FAQ under "flat" (flat structure to hierarchy). An alternative is a forward stepwise tree walk, in which a template matching a sectbreak has you proceed through the following sibling nodes one by one until you get a new sectbreak.


The problem gets more complicated (much more) if your breaks are not all at the same level.

Cheers,
Wendell


___&&__&_&___&_&__&&&__&_&__&__&&____&&_&___&__&_&&_____&__&__&&_____&_&&_ "Thus I make my own use of the telegraph, without consulting the directors, like the sparrows, which I perceive use it extensively for a perch." -- Thoreau


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.