[alicebot-archcomm] [discussion] extension mechanism
Manos Batsis
alicebot-archcomm@list.alicebot.org
Wed, 22 May 2002 14:58:20 +0300
Hi folks,
I'd prefer #1 <extension> instead of introducing a new custom element
per extension. It helps XML validation and semantic awareness. A new
extension element type per extension would be a nightmare!
If we stick to interpreted languages such as python, JavaScript etc, the
code can be embedded in the document using an extensionImplementation
(or whatever) element to be globally accessible:
<extensionImplementation type="text/javascript"
processor="myJSProcessor.exe" id="foo">
<![CDATA[
function noCaseFunc(a, b)
{
var strA = a.toLowerCase(),
strB = b.toLowerCase();
if(strA < strB) return -1;
else if(strA > strB) return 1;
else return 0;
}
]]>
</extensionImplementation>
I've specified the MIME type and local processor. How about remote
services/processors?
How do you guys expect to work out outsourcing of tasks in general?
Anyway, by using standard element names for introducing and using
extensions, you will always know that this is an extension; validation
is easy since you just introduce a complex type to the XML Schema.
Introduction of new namespaces is, IMHO, a complexity we can live
without.
> > > I would characterize the extension mechanism as a
> generalization of the
> > > <system> and <javascript> functions currently available. The
> > > requirements I would like to propose are:
> > >
> > > 1. Unrestricted text content, within the guidelines given
> for XML, for
> > > extension elements.
> > > -- Meaning, any kind of CDATA is acceptable (although in
> cases where
> > > characters need to be "escaped" to avoid conflicts with
> XML they should
> > > be).
Agreed. How about refering to external files?
> > > 4. URI-based specification authority.
> > > -- That is, a URI designates a unique extension. We might want to
> > > recommend something like RDDL as the standard for providing
> > > documentation or other resources at a URI (though it should not be
> > > required). The point is that anyone who can publish a
> legitimate URI
> > > can thereby publish an extension, and the URI is the
> ultimate determiner
> > > of uniqueness for an extension element, rather than any other
> > > characteristics of the element (name, attributes, namespace, etc.)
Welcome to the RDDL fun club :-)
Sorry for my low activity on this thread; I'm over my final exams.
Cheers,
Manos