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

Controlling process flow in a stylesheet?

Subject: Controlling process flow in a stylesheet?
From: "dvint@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Aug 2014 15:58:16 -0000
 Controlling process flow in a stylesheet?
Most of the time I can let the stylesheet just react to elements found and
trigger a given template and that works great.

There are other times where I have content that has variable sections (my
or may not be there) but I need to add information in that section or
create a new one.

I'm looking for a generic foolproof way to process content like this. The
content/DTD is complex enough that there might be many optional elements
defined but never really used by our writing group. My problem is that in
sampling the content to be processed I may not find the one or two uses of
an optional section.

So what I've been doing in situations like this is review the some of the
content and the DTD and determine which sections I need to worry about.
this works as long as I have an accurate sample of the content or I have
analyzed all the possible structure possibilities. So not only are some
sections optional but they might repeat in various combinations.

So what techniques do you use to handle a situation like this? My hard
coded structuring only works in the less complicated situations, is there
a better way?

One thought might be to have the template that treats the content
immediately following the section I want to touch test to see if there was
a section output. I might be able to write a generic template that
processes all elements and have it check to see if there was one of these
sections in the input, if not output one. I'd then have to keep track of
the fact I've created the section, a tunnel parameter might handle the
tracking. I'm not sure what sort of overhead that might put on the overall
processing time.

.dan

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.