On Wed, 2005-07-27 at 08:18 +0200, Nicola Ken Barozzi wrote: > Thorsten Scherler wrote: > ... > > <forrest:hook name="testIdDiv"/> > > *or* > > <forrest:hook name="testIdDiv" type="div"/> > > will be transformed into > > <div name="testIdDiv" /> > > Then why not simply use > > <div name="testIdDiv" /> > > > The same is true for @class attribute for forrest:hooks. > > <forrest:hook class="testClassDiv"/> > > *or* > > <forrest:hook class="testClassDiv" type="div"/> > > will be transformed into > > <div class="testClassDiv" /> > > Then why not simply use: > > <div class="testClassDiv" /> > > > Another feature is that you can as well output span elements for > > forrest:hooks instead of div elements. > > <forrest:hook name="testId" type="span"/> > > will be transformed into > > <span id="testId" /> > > Then why not simply use > > <span id="testId" /> > > ... > > Here is a small summary example: > > <forrest:hook class="testClass" type="span" nbsp="true"/> > > <forrest:hook name="testId" type="span"/> > > <forrest:hook class="testClassDiv" /> > > <forrest:hook name="testIdDiv" type="div" nbsp="true"/> > > > > will be transformed to: > > > > <span class="testClass"> </span> > > <span id="testId" /> > > <div class="testClassDiv" /> > > <div id="testIdDiv"> </div> > > Again, why cannot we use the second version instead of creating another > new language? >
The downside of your suggestion is that it is limited to html. By using <div/> and <span/> we seems to limit the use of "forrest:hooks" to html but like I mentioned in other threads the idea of forrest:views is to have a configuration file not only for html but as well for other formats. Which is the biggest different to e.g. tiles and velocity. If we only want to support html for forrest:views then IMO we are better off using on of them *instead* of forrest:views. I looked a little bit more into velocity and making experiments to use them *within* a forrest:view configuration (*.fv). Actually that would leverage the logic part of forrest:views but still using the new concept in combination with special velocity templates (not outputting html directly but the forrest:view dsl). Now to some arguments for not using <span/>,.... Lets say I want to implement a "fo" forrest:view. If we use <div/> and <span/> we limit the usecase of forrest:hooks to this "graphical helper container" of html which do not exist in fo. A div would probably be e.g. a <fo:block/>. Now using <forrest:hook type="block"/> is easier extensible for new upcoming formats that are based on forrest:views. The other thing is that a hook in e.g. inx can as well structure the document into multiple pages. This hooks do not got transformed into an element but rather used for structuring purposes only. The last example would be something like <forrest:hook type="table"/>. If we use <table/> instead that will not work for fo the same way like in html both format will need another structure for "table". When hiding the implementation behind the "forrest:hook" interface we can use <forrest:hook type="table"/> for html and fo the same way and the format implementation will take of the different processing. Summary: A forrest:hook is an abstract layer for *any* "graphical helper container" (not only html), like an "interface". Each format can implement special matcher and transformer which decide how and whether forrest:hooks get transformed in the final output format. WDYT? salu2 -- thorsten "Together we stand, divided we fall!" Hey you (Pink Floyd)
