Agreed - though I can't help feeling we'd end up reinventing XML validation techniques where just reusing something like RelaxNG, XSD or Schematron might be easier.
James ------- http://radio.weblogs.com/0112098/ ----- Original Message ----- From: "Christian Sell" <[EMAIL PROTECTED]> To: "Jakarta Commons Users List" <[EMAIL PROTECTED]> Sent: Tuesday, February 04, 2003 2:02 PM Subject: Re: [Jelly] restrict use of tag libraries James Strachan wrote: > There's a few ways this could go. We could add a mechanism so that Tag > libraries could restrict the use of other libraries within themselves. e.g. > a specific TagLibrary could dsiable or enable some/all libraries from being > usable within one/all of its tags. > > Another option could be for an individual tag to validate its body inside > the doTag() method. By calling getBody() and then traversing the tree of > TagScripts, a specific Tag could validate that the body does not contain > dynamic expressions or Tags of certain kinds etc. > > The latter would be pretty easy to implement in your specific example I > think. We could maybe provide some kind of helper class (TagWalker?) to aid > Tag implementors wishing to traverse over their bodies, validating child > tags. both seem useful. However, in my case, where I dont want any scripting at all, I could also call getParent() from within my element2, and assert that the class is that of element1, right? In general, I have the feeling that it would be nice if we could delegate more error checking and validation into the runtime, based on declarations provided by the taglib - instead of having to perform it in every tag implementation (or not at all). > > James > ------- > http://radio.weblogs.com/0112098/ > ----- Original Message ----- > From: "Christian Sell" <[EMAIL PROTECTED]> > To: "Jakarta Commons Users List" <[EMAIL PROTECTED]> > Sent: Monday, February 03, 2003 9:51 PM > Subject: Re: [Jelly] restrict use of tag libraries > > > Paul Libbrecht wrote: > >>Christian, >> >>What do you mean by "no taglibs allowed here" ? > > > I mean that writing > > <element1 xmlns="com.yadda.Yadda"> > > *will* go through, but writing > > <element1 xmlns="com.yadda.Yadda" xmlns:y="core"> > > will *not* go through. In fact, what I really want is to make sure that > there is no scripting from other taglibs between my element1 and > element2 - the namespaces are not really the problem. > > < > >>Do you mean no taglib-declaration ? >>Do you mean only the following taglibs' tags ? >> >>In both cases, this has to do with parsing. So a schema, as James >>mentionned, or some other (e.g. forcing a SAX filter between the parser >>and the jelly document-handler). > > > I still dont see what role a "schema" would play here > > >>Remember: jelly scripts are first parsed then executed (possibly several >>times). >>Hope it helps. >> >>Paul >> >> >>Le Lundi, 3 f�vr 2003, � 19:35 Europe/Berlin, Christian Sell a �crit : >> >> >>><element1 xmlns="com.yadda.Yadda"> <!-- no taglibs allowed here --> >>> <element2 xmlns:j="jelly:core" xmlns:log="jelly:log"> >>> <j:something/> >>> ..... >>> </mytags:element2> >>></mytags:element1> >> >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > __________________________________________________ > Do You Yahoo!? > Everything you'll ever need on one web page > from News and Sport to Email and Music Charts > http://uk.my.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
