[Zopexmlmethods-devel] =?iso-8859-1?Q?Interface_for_XPathMethod=3F?=
Brought to you by:
arielpartners,
philikon
From: Craeg S. <cs...@ar...> - 2003-06-09 04:50:47
|
It seems that most processors have encapsulated XPath expressions in a type, and have a notion of pre-compiling them, all except for Sablotron. Of course, each processor has its own special type, and we don't want to expose that to XPathMethod. What about this for an interface: IXPathProcessor def compile(expression): "return handle to compiled expression or expr itself" def evaluate(xmlString, xmlURL, xpath): "return pretty printed result of xpath evaluation" Eventually, all of the processors can implement both IXSLTProcessor and IXPathProcessor. As a matter of fact, how about I start out implementing only FourSuite, and simply leave the other processors _not_ implementing IXPathProcessor for now. Then we have to extend ProcessorChooser to understand interfaces-- you ask "tell me the list of processors available for XXX" where XXX is xpath, xslt, dtd, etc. That's interesting, because now we need to know both a) a compiletime notion of whether a particular processor supports feature X (either yes, no, or yes but we haven't implemented it yet) b) a runtime notion of whether a particular processor is currently installed For (a) I guess we just say if IXPathProcessor.isImplementedBy(processor): # try it... Thoughts? --Craeg |