Greg Weinger wrote: > > > But this is not enough: behavioral description *depends* on > > the type of the exposed resource. > > > > For example, a resource such as > > > > block:skin://xslt/document2html > > > > will have to expose the returning MIME-type (XSLT in this > > case) as well as it's schema, as well as the schema of the > > conten that it's capable of transforming and the schema of > > the content that is capable of generating after the transformation. > > How difficult would it be write code that automatically generates these > "entry" and "exit" xml schema contracts for a stylesheet?
Well, honestly I don't know: everything I start thinking about something like that I don't even reach half of the complexity that my minds blows up and you know I'm not that new to high level abstractions :) But it seems to me it's probably one of the most complex things *ever* in the realm of structured languaged, but I'm wide open to suggestions. > The block > deployment code could create them for you. For hard-coded components, > it's up to the developer. > > The converse would also be useful; like a generic unit test for a > stylesheet, based on these "entry" and "exit" schemas, it would > determine if the stylesheet "satisfies" the contract. > > I am working on a cocoon application with dynamically pluggable > stylesheets that needs something like that. Without any kind of > validation, the system is just too brittle, and anyone who writes a bad > stylesheet can wreak havoc. Yes, I'm totally aware of this, but I'm not sure you understand the complexity of the problem. Suppose you have something like this: A -> [1] -> B where A,B are two XML documents and [1] is an XSLT stylesheet. The first thing to say is that the validation engine must be namespace capable, this automatically rules out DTDs. My personal suggestion, since this is a validation phase and shouldn't mess with the infoset, would be to use RelaxNG. But other than that I get stuck :/ Scott, Norm, do you have any useful information for us on this subject? I mean: did you guys in the XSLT WG ever thought about 'validating' the stylesheet behavior against a pipeline flow rather than validating the stylesheet *itself*? -- Stefano Mazzocchi One must still have chaos in oneself to be able to give birth to a dancing star. <[EMAIL PROTECTED]> Friedrich Nietzsche -------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]