[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re: Multiple elements condition
At 06:14 PM 8/29/2007, you wrote:
> But I might opt for note[count(para)=2] as it's both concise, and > quite obvious. Yes, I know. This presents me with one of those problems that's both philosophical and practical. Do I code against the possibility of poor or naive XSLT engines, even when the legibility and hence maintainability of my code suffers as a consequence? The answer: frequently, yes. But often, there are other mitigating factors. For example, I may know that there will never be more than a few para elements. Or I may know that only a particular processor, which knows how to optimize such expressions, is being used. Or I may be writing a one-off, which I'll run just once or a few times, and if there are performance problems I can deal with them lazily. (FWIW, I almost never have performance problems with my XSLT. I think that has more to do with the scenarios for which I write -- the scale of the documents and data sets -- than it does with the way I write.) So here's my style question of the month. In XSLT 2.0, should I prefer: exists(para[2]) and not(exists(para[3])) or exists(para[2]) and empty(para[3]) ? Is there ever any difference in functionality? I think the first is marginally more legible, but maybe the second gets out of the gate a microsecond faster. 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 ======================================================================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|