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

RE: Apply-templates - how to omit top level element ta

Subject: RE: Apply-templates - how to omit top level element tags?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 9 Sep 2005 23:36:15 +0100
RE:  Apply-templates - how to omit top level element ta
> XSL is fragile because you can break things by messing
> around?  That's pretty much true of any complex system.

Yes: though more true of some systems than of others.

XSLT 1.0 is designed with a rather different notion of robustness than many
other languages: it's designed on the principle that if you hit something
unexpected in the input, you should struggle on to produce some kind of
output rather than catching fire and printing a stacktrace on the poor
user's screen. There are times when this is quite a good idea. But it does
have the consequence that writing incorrect code often causes the stylesheet
to produce garbage output. Other languages have a different notion of
robustness: incorrect code should wherever possible produce an error message
to tell you what you've done wrong.

XSLT 2.0, especially if you opt for schema-awareness, has swung a long way
towards this more conventional definition of robustness. Write a schema
describing the input document, and a schema describing the output document,
and write your stylesheet code to be schema-aware, and you will find that
many of your coding errors are detected at compile time, or failing that at
run-time. If this is a style you are more comfortable with, give
schema-aware XSLT a try, and tell us how you get on.

Michael Kay
http://www.saxonica.com/

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.