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

Re: How to avoid careless mistakes when using XSLT mod

Subject: Re: How to avoid careless mistakes when using XSLT modes?
From: "David Sewell dsewell@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Apr 2019 18:53:31 -0000
Re:  How to avoid careless mistakes when using XSLT mod
Yes, indeed--now to train my eye to pay attention to that!

On Fri, 19 Apr 2019, Debbie Lapeyre dalapeyre@xxxxxxxxxxxxxxxx wrote:

If you are working in Oxygen, or similar XML editor,
viewing the outline of an XSLT stylesheet also
displays the modes for each template. You can make
sure they all match that should, see at a glance which
template is in no mode at all, or one, or
two... Oxygen also lets you sort by mode in this view.

--Debbie



On Apr 19, 2019, at 2:41 PM, David Sewell dsewell@xxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

I just spent too much time completely puzzled about why a particular template was not producing correct/expected output before realizing that in many cases the template was not matching anything -- because some time ago I had added a mode to certain instances of <xsl:template> and <xsl:apply-templates> without being sure to adjust other templates in the stylesheet.

Adding mode="#all" to my failing template fixed the problem.

Obviously one could prevent many such problems by checking for the existence of @mode in a stylesheet before working with it. Remembering always to do that is the problem. Any other suggestions? (I guess one could make a habit of adding an <xsl:message> to the template matching the root to warn that the template is using modes.)

David

--
David Sewell
Manager of Digital Initiatives
The University of Virginia Press
Email: dsewell@xxxxxxxxxxxx   Tel: +1 434 924 9973
Web: http://www.upress.virginia.edu/rotunda



================================================================
Deborah A Lapeyre              mailto:dalapeyre@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.      http://www.mulberrytech.com
17 West Jefferson Street         Phone: 301-315-9631 (USA)
Suite 207                        Fax:   301-315-8385
Rockville, MD 20850
----------------------------------------------------------------
Mulberry Technologies: Consultancy for XML, XSLT, and Schematron
================================================================



-- David Sewell Manager of Digital Initiatives The University of Virginia Press Email: dsewell@xxxxxxxxxxxx Tel: +1 434 924 9973 Web: http://www.upress.virginia.edu/rotunda

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.