Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] XPath "//", speed, and Saxon

From: Tony Graham <Tony.Graham@---------------------->
To:
Date: 11/3/2008 2:44:00 PM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent