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

Re: XPath "//", speed, and Saxon

Subject: Re: XPath "//", speed, and Saxon
From: Tony Graham <Tony.Graham@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 03 Nov 2008 14:37:13 +0000
Re:  XPath "//"
On Mon, Nov 03 2008 12:55:12 +0000, mike@xxxxxxxxxxxx wrote:
>> A lot of time, effort and money goes into testing, but for 
>> XSLT, I think that effort would be better spent on fully 
>> schema aware transforms than unit testing.  What do you think?
>
> I think a lot of stylesheets go into production after testing with a very
> small sample of input documents. It's often too expensive to do anything

I concur.

> else. In this situation, developing with schema awareness can greatly
> increase your confidence that the stylesheet will also be able to handle
> input documents that vary significantly from your initial sample.

Up to a point.  If you neglect to handle an optional input element or
attribute or you map the wrong input to a valid output element or
attribute, then having a schema isn't going to help much.

An up-front good mapping from input to output still trumps the
combination of a schema-aware processor and designing at the keyboard.
(And, yes, a schema-aware processor and some planning could trump both.)

A schema is a useful guide for what to expect, and having input that is
schema-valid means that you don't have to prepare (as much) to handle
unexpected input.

In some ways, the old-fashioned 'match="*"' template rule that emits a
message or outputs the element name in red for any element that isn't
handled elsewhere is still useful even when you have schema awareness.

Schema awareness awareness is useful too: I have met the approach that
the schema is really only useful for working out what to put in "match"
attributes.  (That person was using XSLTC translets, so couldn't have
done much with the schema even if he'd wanted to.)

Something like XSLV for verifying that valid input produces valid output
or a coverage tool (non-existent, AFAIK) that tells you whether your
stylesheet can handle everything in a schema would also still be useful.

Regards,


Tony Graham                         Tony.Graham@xxxxxxxxxxxxxxxxxxxxxx
Director                                  W3C XSL FO SG Invited Expert
Menteith Consulting Ltd
XML, XSL and XSLT consulting, programming and training
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
Registered in Ireland - No. 428599   http://www.menteithconsulting.com
  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
xmlroff XSL Formatter                               http://xmlroff.org
xslide Emacs mode                  http://www.menteith.com/wiki/xslide
Unicode: A Primer                               urn:isbn:0-7645-4625-2

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.