Lists Home |
Date Index |
> 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:
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?
> Statically typed XPatterns are not the obvious solution to even (1)
> and (2).
I think that they address (1), but not (2).