[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: Michael Kay <mike@xxxxxxxxxxxx>
Date: Sun, 14 Nov 2010 12:53:13 +0000
Re:  [XSLT 1.0] Q: recursively eliminate empty nodes
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?


I'm trying to recall the reasoning. It was something like this: In XSLT 1.0, "/" (or a union with "/" as one of its branches) was the only pattern that could ever match a document (aka root) node. So its priority didn't really matter much, except perhaps in the artificial case where you have two templates saying match="/", one with an explicit priority and one without. In 2.0 it made sense to align its priority with other patterns where the node-kind and nothing else was known: it means the same as match="document-node()" which should logically have the same priority as "element()" or "attribute()" or "text()". Retaining the 1.0 priority would have meant match="/" having a higher priority than match="document-node(element(invoice))", which would be counter-intuitive.

Michael Kay
Saxonica

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.