forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <>
Subject Re: forrest:hooks configurations examples (was [Views] <div id="titi"/> strange behaviour)
Date Wed, 27 Jul 2005 09:28:07 GMT
Thorsten Scherler wrote:
> On Wed, 2005-07-27 at 08:18 +0200, Nicola Ken Barozzi wrote:
>>Thorsten Scherler wrote:
>>>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. 

It is not, it's just naming.

What makes:

  <forrest:hook class="testClassDiv" />

less html-dependant than:

  <span class="testClass"> </span>

> 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.

Wait a second, I don't mean that writing <span> I want that outputted

What I really mean is:

  <forrest:span forrest:class="testClass"> </forrest:span>

Using a default namespace, it becomes:

  <span class="testClass"> </span>

Nicola Ken Barozzi         
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)

View raw message