Re: [xsl] template matching with modes, not seeing what I expect

Subject: Re: [xsl] template matching with modes, not seeing what I expect
From: "Trevor Nicholls trevor@xxxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 16 Mar 2020 18:10:46 -0000
Ken, I would *love* to write tests that separate my sections into three
categories using simple language and the full power of XSL. I tried. I gave
up. I reverted to something simple that works.
A pointer from you might go a long way.

Keep safe

-----Original Message-----
From: G. Ken Holman g.ken.holman@xxxxxxxxx
Sent: Tuesday, 17 March 2020 3:35
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx; xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] template matching with modes, not seeing what I expect

At 2020-03-16 09:58 +0000, Trevor Nicholls trevor@xxxxxxxxxxxxxxxxxx wrote:
>I'd really like to understand how to do it without counting but I seem 
>to have a mental block with some kinds of nodeset logic, plus the count 
>method will at least be instantly comprehensible if somebody else has 
>to look at this stylesheet in the future.

I disagree. If the language isn't being used properly, someone in the know
maintaining the stylesheets will have to figure out why it wasn't used
properly in the first place and likely will have to re-engineer it to do it

And by not using the language properly, you are missing out on the
opportunities the XSLT engine can take to optimize a proper implementation.

I saw this in the classroom: it works this way, why not just use it? 
Because the language has features and facilities that promote future
extensions of the stylesheets and extensions of the source content, they
should be used properly. One shouldn't be projecting on their style of
writing XSLT how other languages work when the basis of those other
languages is very different.

At least doing so has served me and my customers well in the past.

. . . . . . Ken

Contact info, blog, articles, etc. |
Check our site for free XML, XSLT, XSL-FO and UBL developer resources |
Streaming hands-on XSLT/XPath 2 training class @ US$45 (5 hours free) |
Essays (UBL, XML, etc.) |

Current Thread