[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subject: Re: [XSLT 1.0] Q: recursively eliminate empty nodes
From: Evan Lenz <evan@xxxxxxxxxxxx>
Date: Fri, 12 Nov 2010 23:18:54 -0800
Re:  [XSLT 1.0] Q: recursively eliminate empty nodes
On 11/12/10 9:54 AM, Wendell Piez wrote:
At 09:40 PM 11/11/2010, you wrote:
A rule I find easy to remember is that a pattern has the highest default priority (0.5) if and only if it contains a "/", "//", or "[..]"

Hm. So does it have the lowest if and only if it doesn't have any of these, or ":" (indicating a namespace prefix), but it does have "*" or "()"? (indicating a wildcard or kind test?)


The lowest-priority patterns are special in that you can exhaustively enumerate them all.

For XSLT 1.0, I created a table listing these:
http://lenzconsulting.com/how-xslt-works/#priority

There are only 6 patterns (not including their alternate "child::" or "attribute::" forms) that have a default priority of -0.5. That's because it's the only default priority level where no names (or steps or filters) are used. XSLT 2.0 adds a few more to the list with the ElementTest and AttributeTest forms.

I just noticed (from here: http://www.w3.org/TR/xslt20/#dt-default-priority) that in XSLT 2.0, "/" has priority -0.5, whereas it has +0.5 in XSLT 1.0. I was surprised to see this. Maybe it has no practical impact (other than invalidating my easy-to-remember rule). Or am I missing something?

Evan

--
Evan Lenz
Lenz Consulting Group, Inc.
http://lenzconsulting.com
+1 (360) 297-0087

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.