Re: [xsl] Avoiding boneheaded mistakes in XSLT?

Subject: Re: [xsl] Avoiding boneheaded mistakes in XSLT?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Thu, 30 Dec 2010 13:48:16 +0000
What is useful, has already been provided by SA processors for years.

I'm glad you think so, but I think there are still opportunities to get better.

For example, Saxon 9.3, when you call an unknown function, tries quite hard to discover what you did wrong - for example, it will recognize common misspellings of the Saxon namespace. Improving the diagnostics here reduces the number of support calls. Similarly, the schema validator when it encounters an element name that is not allowed in a particular position tries to work out whether you spelt the element name wrong or used the right element name in the wrong place. I think there's an inexhaustible number of refinements that can be made to improve feedback for people who make mistakes, and I shall keep trying!

Producing warnings for constructs that could be correct comes into a different category. Saxon has always produced some such warnings for things that are obviously wrong, even though legal (for example @A/@B), and I think there is plenty more scope to be smarter. For example, If someone writes book/isbn when the schema (or indeed the instance) contains book/@isbn, I think the probability that this is incorrect is sufficiently high to justify a warning, provided it can be suppressed at user option.

Michael Kay

Current Thread