[
Lists Home |
Date Index |
Thread Index
]
> The Source interface does not have close to
> enough functionality to allow it to be used as input to a
> transform or
> validation or anything else. The whole interface is two methods,
> getSystemId() and setSystemId(). There's so little useful
> functionality
> here one wonders why they bothered with a separate interface at all.
Have you seen the alternatives, like the .NET transformation API with about
20 overloaded transform() methods?
Designing this kind of API is tough, and I think the device of the Source
and Result interfaces is actually a very elegant solution. It's much better
than the alternative, which has been used in the XPath API, of using Object.
Of course it doesn't mean that any transformation engine can accept any kind
of Source, but it does enable each engine to accept a wide variety of
different kinds of Source without an explosion of polymorphic methods.
It also allows a transformation engine potentially to provide a
configuration interface that allows third parties to interface the engine to
new kinds of Source. Saxon is getting close to that. That wouldn't be
possible if there were 36 methods to support every combination of 6 types of
Source and 6 types of result.
Michael Kay
http://www.saxonica.com/
|