[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
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) 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
|
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
|