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

Re: XPath that returns nothing

Subject: Re: XPath that returns nothing
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 29 Sep 2011 11:33:07 -0400
Re:  XPath that returns nothing
Hi,

On 9/29/2011 6:30 AM, David Carlisle wrote:
adding
<xsl:if test="*[2] or not(definition)">
<xsl:message>.....

in lots of places makes the transformation resemble a schematron schema
more than a transformation at times (and probably the xslt engine spends
as long doing those checks as anything else), but having the messaging
inserted at the point that the transformation fails (often an
xsl:otherwise or match="*" default case) rather than have a separate
schematron try to second-guess what input the transformation can validly
handle means that the error reporting is more accurate, and (perhaps)
more likely to get run every time.

I agree. Plus, when this gets to be a normal thing, one ends up with constructs such as


<xsl:variable name="unexpected" select="not(count(definition) eq 1)"/>
<xsl:apply-templates mode="erroneous" select=".[$unexpected]"/>

with the "erroneous" mode handling all the messaging (and possibly discriminating between different error conditions).

The bottom line is that this is one of the areas where one finds that engineering a transformation to work well in a pipeline introduces a new set of requirements, all by itself.

Cheers,
Wendell

--
======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

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.