Re: XPath/XSLT 2.0 concerns
Hi Uche, > While I can understand, and perhaps with your reasoning here, I must > say that I write a *lot* of XSLT and have never once come across the > need for either (1) or (2). I have also worked with a lot of other > people's XSLT, and haven't seen very many usage patterns that would > be simplified by template matches based on types. Interesting. I guess that I mainly come across it when I'm dealing with document-oriented XML. For example, I have lots of match patterns that look like: *[starts-with(local-name(), 'sect')] at the moment in order to treat all sections ('sectA', 'sectB', ...) in the same way, and I've recently taken to defining an is-block() function in order to work out whether an element is a block elements in order to know whether they need to be pulled out of paragraphs (since HTML can't handle nested block elements within paragraphs, whereas the source language I'm working with can). I'm not saying that XSLT 1.0 *can't* do these things, but when I find myself writing exactly the same match pattern time after time, I begin to think that the elements share something in common, and that really, for maintainability, I should only have to specify that once. > Nevertheless, a generic annotation system would solve both these > requirements, no? Absolutely! > Statically typed XPatterns are not the obvious solution to even (1) > and (2). I think that they address (1), but not (2). Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/
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