Re: [xsl] XSLT Hello World - outreach

Subject: Re: [xsl] XSLT Hello World - outreach
From: Brian Chrisman <brchrisman@xxxxxxxxx>
Date: Fri, 28 Mar 2014 14:02:40 -0700
On Fri, Mar 28, 2014 at 11:03 AM, Rick Quatro <rick@xxxxxxxxxxxxxx> wrote:
> I think XSLT is difficult for "traditional" programmers because the basic
rules of functional programming are not familiar to them, or they are not even
aware of them. In some cases, it is easier to fall back on what you are
familiar with. For example, today I was given this task: For each element,
check to see if each child element has the same "audience" attribute value. If
it does, promote the attribute value up to the element, and delete the
attribute on each child. And repeat this on the document tree until the values
can't bubble up any further. I wanted to use XSLT for this, but I couldn't
readily think of how to do it. So I used a familiar procedural language and
did it in about an hour.
>
> Although my client will be happy, I "cheated" myself out of a chance to
learn to do it with XSLT, and gain a broader understanding of the language.
But sometimes this is the reality of the situation.

Okay... is it me, or is this one of those exceedingly rare cases where
you actually want the 'A!=B' test instead of 'not(A=B)'?
ie, test="*[1]/@audience!=*/@audience" would tell us when something in
this case is 'not' to be promoted?

- Brian


>
> Rick

Current Thread