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

Re: mode

Subject: Re: mode
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 14 Apr 2011 15:47:50 -0400
Re:  mode
At 2011-04-14 20:40 +0100, Andrew Welch wrote:
> Remember that mode names can be namespace qualified. When I create XSLT
> stylesheet libraries, I use two namespaces for the name of the modes engaged
> therein: a public one that my library users are allowed to use (to exploit
> the library), and a private one that my library users are expressly told not
> to use (so as not to inadvertently interfere with the operation of the
> library).


That's an interesting workaround to the lack of visibility modifiers
for the xslt library designer...

I use the same two-namespace convention for all globally-declared variables in the library. And keys. And named templates. *Everything* with a globally-scoped name in the library is namespace qualified. I don't bother with locally-scoped variables.


Without namespaces, if my imported library makes use of a global variable named "x", and my user's importing stylesheet inadvertently declares its own variable named "x", then my library won't work as expected.

Namespaces in libraries avoid execution errors and duplicate declaration errors.

Very useful. And this approach has been available since day one of XSLT 1.0 and so has been a long-time practice for me. I first started using it when contracted to create a library being sent out of the development team to many remote departments who were going to have their own developers write importing stylesheets.

. . . . . . . . . . Ken

--
Contact us for world-wide XML consulting & instructor-led training
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

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.