On Fri, Mar 28, 2014 at 11:03 AM, Rick Quatro <rick(_at_)rickquatro(_dot_)com>
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
--~------------------------------------------------------------------
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>
--~--