Subject: Re: [xsl] XPath that returns nothing From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Thu, 29 Sep 2011 11:33:07 -0400 |
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.
<xsl:variable name="unexpected" select="not(count(definition) eq 1)"/> <xsl:apply-templates mode="erroneous" select=".[$unexpected]"/>
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XPath that returns nothin, Andrew Welch | Thread | [xsl] Re: XPath that returns nothin, Olivier Lefevre |
Re: [xsl] Identifying unique attrib, Martin Honnen | Date | Re: [xsl] Identifying unique attrib, Mark |
Month |