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

Re: Avoiding boneheaded mistakes in XSLT?

Subject: Re: Avoiding boneheaded mistakes in XSLT?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 29 Dec 2010 15:20:35 +0000
Re:  Avoiding boneheaded mistakes in XSLT?
On 29/12/2010 14:39, Dave Pawson wrote:

Even without schema awareness/context, surely the processor can
tell when an xpath expression will result in zero match?



some things, like /.. but not things like the example at the start of the thread where you go foo/node instead of foo/node()

and most instances of /.. even though it can never select anything are not an error, as it was a common xslt 1 idiom for an empty node set equivalent to xpath2's () and it is often still used now, out of habit, or copying old tutorials.

something like schematron relies on you being able to match things that should not be there, so it can report when they are there.

the html schema will tell you you can't have two <body> children of <html> but that doesn't tell you that html/body[2] will not select anything unless your processing environment ensures that all input is validated, and not passed to xslt if it is not valid. that is not the most common xslt processing model.

David

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.