Re: [xsl] Re: OOXML

Subject: Re: [xsl] Re: OOXML
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 30 Jun 2008 09:56:15 +0100
Shouldn't this be titled OOXSL??  Anyway...


> The two main highlights of OO languages are encapsulation and inheritance:
> -XSLT already has a nice inheritance model i.e. imports and template precedence.
> -XSLT stylesheets can be thought of classes, with data (variables,
> parameters) and functions as methods.

I've always thought we could do with equivalents for Final and Abstract:

- mark a template as Final and it can't be overridden, or more
specifically to XSLT, it will always be chosen regardless of import
precedence.  This would be a way of bypassing the subtle import
precedence rule that order of import statements is king. (Currently
the priority attribute is considered after that precedence rule making
it weak for large import trees)

- mark a template as Abstract and it must be overridden, allowing you
to design stylesheets that must be imported into others and give a
good error message when they're run on their own.  Ok, this one can be
easily worked around with a runtime error, but it would be nice if
when working with the importing stylesheet you could be told that a
particular template/function needs to implemented...


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

Current Thread