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

RE: Apply-templates - how to omit top level element ta

Subject: RE: Apply-templates - how to omit top level element tags?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 07 Sep 2005 19:14:36 -0400
after effects templates
Mike

As others have suggested, the canonical approach to handling a given element in different ways is to qualify your templates with modes.

This isn't the only approach, but it's probably the best path to explore.

At 07:07 PM 9/7/2005, you wrote:
Jay Bryant>> Do you dislike the apply and match scheme (XSLT's native
idiom)

Good question. Honestly I don't think I currently think that way so I
don't know (such as an English speaker has to translate from German to
be able to understand, whereas a fluent German speaker "thinks" in
German.)  It seems fraught with side-effects, however, and it seems hard
to verify that output is "correct" when using that idiom.

It's certainly true that those who are experienced in other kinds of programming frequently find they have to re-wire their brains to get the most out of XSLT. (Some have been fortunate to work with other functional languages and have already done the rewiring; others were never wired "wrong" to begin with.)


As for the strengths and weaknesses of the paradigm: not only is processing with templates not fraught with side-effects -- actually side-effects (in the strict technical sense of having the state of the processor being altered by the processing as it goes) is precisely what the XSLT paradigm is designed to *avoid*. So, no side effects. While it is possible to get around this in XSLT, it's not easy. Yet even this can take getting used to: like walking on a floor after you're used to walking on tightropes.

You have a much stronger point in asking about the verifiability of the correctness of your output. Depending on how "correctness" is defined in given cases, however, it turns out that in practice most stylesheets turn out to be fairly transparent -- so even when they're difficult to verify formally, they turn out to be very dependable if constructed properly.

Also, there are often brute-force methods of verification available, such as validating the output against the schema of your choice (shocking!).

Likewise, this is an area that will be significantly improved by the schema-aware version of XSLT 2.0 (for those content to use W3C XML Schema).

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.