xsl-list
[Top] [All Lists]

Re: [xsl] Relationships in for-each statement

2006-09-08 10:00:41
Dire Confessions Dept.: I'm a technical writer. But we're moving my
department into single-sourcing its documentation as XML data, and it
behooves me to rev up on all the relevant related languages. But I
have a little programming sense (built on a first year university
programming class and lots of trial and error) which is standing me in
good stead. :-)

This XSLT is going to replace a 500-line Perl program which a)
imported all the XTVD data into a Perl structure b) filtered that
based on my desired search items c) exported a new XML data structure
d) which was then operated on by an XSLT sheet for prettiness. This
new all-in-one XSLT sheet ... well, I'm pushing myself to get the line
count down further, but it looks like 225 will be the leanest my
feeble skills will get to right now.

Bob Portnell
simply(_dot_)bobp(_at_)gmail(_dot_)com

On 9/8/06, Wendell Piez <wapiez(_at_)mulberrytech(_dot_)com> wrote:
Bob,

At 06:44 PM 9/7/2006, you wrote:
>>First, it doesn't look to me like you need that xsl:if test at all.
>>As on other occasions, if no such nodes exist, a for-each instruction
>>won't select any to operate on.
>
>:-) "While we were in a commercial break," that xsl:if test lets me
>know I need to output a proper header for the group of items to
>follow.

Well in that case ... you're sure to have figured out that having to
use the same monster path twice -- once in an xsl:if for the "wrapper
logic" and a second time inside the "if" clause to select the nodes
themselves -- makes for all the more reason to bind it to a variable.
It will prevent a processor that has no optimization for this from
looking through the entire document repeatedly for the same nodes.

>Yeah, I saw that from David. I'm very excited about that, for more
>than one reason.

As for being excited by this: I guess that's what makes you a
computer programmer.

Cheers,
Wendell


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>