Craeg K Strong wrote:
> Philipp von Weitershausen wrote:
>
>> I know for a fact that XML-Schema uses an attribute like
>> xsi:schemaLocations="someuri" in the document element to refer to a
>> certain schema.
>
> OK, that's good to know. So if we had a "Schema-URI" property for our
> "XMLValidateMethod" (I like that name) Zope object, then it could be
> optional for DTD/XMLSchema, but mandatory for Schematron, for
> example. I guess that's not so bad, if we make it clear in the docs.
> Just a bit crufty, tho...
Yeah, quite crufty. However, first checking the XML whether any XML
schema is mentioned and then offering a manual input seems the best
solution for this problem.
> As per the @@FIXME, we will want to differentiate the names of the
> methods (OK, I admit it.
> Sometimes I miss method overloading a la Java/C++). Any suggestions?
I think we have to go with different method names. :(
>> Maybe we'd also like to call them Processor instead of Validator, in
>> order to be consistent with IXPathProcessor and IXSLTProcessor.
>
> So, you are thinking there will be lots of other things to do with
> Schemas, such as automatically generating forms, python adaptor
> classes, or whatnot. The stuff that is already being done in Zope3,
> right? And you are thinking of adding these methods to the
> IxxxSchemaProcessor interface rather than creating separate, smaller
> interfaces. Hard to tell which is better, at this early stage, no?
Heh, I was actually not thinking about ANY of these :) I was just
wondering whether it would be more consistent if we'd name the
interfaces IxxxSchemaProcessor instead of IxxxSchemaValidator because
they will be implemented by a *processor* (e.g. the FourSuiteProcessor).
Your ideas sound sweet, but to be honest, I doubt that they will be any
useful in Zope2. This is rather a Z3 thing since it comes with automatic
form generation and component architecture using adaptors.
>> Will there be an XMLValidateMethod object like XPathMethod or
>> XSLTMethod? Is this what you meant with "creating four small Zope
>> classes"?
>
> Yes. The choice is pretty simple:
> a) DTDValidateMethod, SchematronValidateMethod, etc. all inheriting from
> a ValidateMethod base class (cleaner, more OO) or
> b) A single XMLValidateMethod class, and you set a property to
> indicate the validation method you wish. (less clean, but maybe less
> code, fewer externally visible moving parts)
I'd go with b).
> I think this goes without saying. In fact, I would say that the "zope
> object ID" such as what we have in XSLTMethod, is really just a
> short cut for a "zope protocol" URI zope:foo/bar/mumble.xsl And you
> can use the zope protocol, FTP, file, HTTP, or whatever other URI
> protocol supported by your processsor of choice. Essentially,
> ZopeXMLMethods has extended the processor libraries to understand
> this addtional protocol. The Zope protocol features acquisition, etc.
> Perhaps it is more correct to call it the ZODB protocol? dunno.
I'd say zope:// sounds good, but I'm not sure whether we'd want file://.
Maybe file:// would be zope:// and we wouldn't have to invent another
protocol prefix? This would ease things for 3rd party products that
would "mount" the ZODB over FTP, WebDAV or whatever and rever to the
entities over the file:// protocol.
> It was something about
> a) how deep the inheritance hierarchy was, and/or
no, I don't think so.
> b) whether the zope base classe was listed first or not.
yes. That rings a bell. I'm not an expert, but I now that you mention
it, I think that was the problem.
Phil
|