Re: [xsl] xsl:apply-templates to all but...

Subject: Re: [xsl] xsl:apply-templates to all but...
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 17 Feb 2006 11:34:07 -0500
Hey Bob,

At 09:40 AM 2/17/2006, Bob wrote:
> <xsl:apply-templates select="*[not(self::y)][not(self::z)]"/>

Nice idea, I'm glad I asked!

I'd have written "*[not(self::y|self::z)]" but that amounts to the same thing.

Nevertheless I have used the technique you described, though not for precisely the same reason (controlling ordering), so maybe it's not the same technique.

 And (thanks Michael) once again XSLT 2.0, or
in this case XPath 2.0, makes something else possible with a more concise

Yes, XPath 2.0 is pretty cool once you get the hang of it.

I think (at least) two things were done right:

* Things that work in XPath 1.0 work in 2.0 in just the same way, with very few exceptions, and those throw errors
* The sequences model is consistently designed, so that even though it's very different from the "set-based" model, it's not hard to learn. The fact that "z, y, * except (y|z)" is so straightforward is an indication of this.

I do still have some concern that the new XPath, given its greater complexity (especially when it comes to the data typing), won't be as easy to learn or as easy to fake as 1.0, and consequently will prove to be more of an impediment to picking up XSLT. (IMO XSLT has really benefited from the fact that alert and resourceful people even with little programming experience somehow manage to build solutions with it, and I don't want to see this change. I ascribe this in large part to the fact that it's possible to ignore the gnarlier possibilities of XPath until you get a feel for template-based processing, and once you've got that, the rest makes much more sense.) This is complicated by sociological factors: will it prove to be less burdensome and troublesome (and for whom?) to learn XPath 1.0 first, or just skip it? To what extent will the user communities overlap? I can see XPath 2.0 users who have never dealt with 1.0 getting very frustrated if they have to maintain 1.0 stylesheets.


Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.      
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
  Mulberry Technologies: A Consultancy Specializing in SGML and XML

Current Thread