Philipp von Weitershausen wrote:
> Craeg K Strong wrote:
>
>> Philipp von Weitershausen wrote:
>> 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.
Yikes! Impossible. Remember that a single instance of xxxValidateMethod
will be applied
to *many* different XML documents. Some of those documents might
explicitly mention a schema,
some might not. In fact, you might add an xxxValidateMethod before
*any* XML documents
exist. Same as XSLTMethod and XPathMethod, no?
>>> 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).
Oh. In the absence of anything else, I like Validator more, because it
best describes what we are doing.
However, if the interface becomes more general than that, I would
support renaming. We can evolve this
as necessary (at least until we make an official release :-)
> 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.
I understand. Let's wait and see. Someone may identify a compelling
use case
for which we just can't wait for Zope3 :) Of course, it would have
to be something
that provided high value at reasonably low (coding) cost...
>>> 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).
Do you still vote for this, even after my "Yikes!" comment (above)?
>> 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.
Yeah. This is getting into VFS territory. This is not something I am
motivated to explore in Zope2.
However, I really think Zope3 needs to do something here. Of course, I
am speaking from ignorance.
There may already be good stuff going on there. My plan is to dive in
as soon as the 3X beta happens ~ 1 month(?)
>> 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.
OK, I think that is fairly easily avoided...
--Craeg
|