Re: [xsl] [XSLT 1.0] Q: recursively eliminate empty nodes

Subject: Re: [xsl] [XSLT 1.0] Q: recursively eliminate empty nodes
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Wed, 10 Nov 2010 09:16:58 +0000
Here's a breakdown of various types of XSLT 1.0 and XSLT 2.0 patterns
grouped by their default priority values.  (Someone please correct me
if any of this is either inaccurate or incomplete.)

Rather than referring to this list, it might be better to understand and memorize the principles.


Priority 0 is used when the node kind and either the name or type are known, but nothing else. This is the most common kind of pattern, so zero acts as the baseline.

Priority -0.5 is used when only the node kind is known (or in the case of node(), not even that), but the name is unknown.

Priority -0.25 (intermediate) is used when the node name is partially known (URI or local part, but not both).

Priority +0.25 is used when the node kind, name, and type are known

Priority +0.5 is used for everything else: typically, but not exclusively, when the pattern includes filters or constraints on the node's ancestory.


I just use identity template priority -9 as universal for life
I don't. Using the default priority has never given me any problems.

Michael Kay
Saxonica

Current Thread