Re: Component interfaces

Norman Walsh wrote:
> I was struck last week by Alex's observation that in his
> implementation almost everything is a component. Then when I was
> thinking about iteration in reading the thread following Jeni's
> message, and it struck me that we could take the following approach:
> 
> Every component accepts as input a (possibly empty) set of parameters
> and a sequence of nodes. It produces as its result a sequence of
> nodes. Anything with that interface can be a component.
> 
> Then each component must describe what it does with its sequence of
> inputs. Some components, like XInclude or validation, can just perform
> their function on each node of input producing a corresponding node of
> output. 

We must be aware that by having a sequence of nodes, we must identify 
which node is processed by default. While with XInclude this is not 
needed, we do need it in XSLT processing (default document vs. secondary 
documents grabbed through the document() function).


> 
> Note that we can invent several namespaces if we want to, so that
> parameters can be expressed as attributes on the "component element"
> or passed to the component in a document in the "parameters"
> namespace. Similarly, we can (perhaps) reduce errors to "producing an
> output node in the 'error' namespace".

I agree, with a simple remark that maybe it should be useful to specify 
whether a parameter is required or optional.



Cheers,


Rui

Received on Wednesday, 11 January 2006 10:21:52 UTC