forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject Re: [<div/> again]
Date Tue, 02 Aug 2005 09:20:32 GMT
On Tue, 2005-08-02 at 10:19 +0200, Cyriaque Dupoirieux wrote:
> Cyriaque Dupoirieux a écrit :
> 
> > Ok, I think there is a problem - or at least something different - 
> > with cocoon transformations during views generation process.
> >
> > If I generate the site with the skin (not the view plug in) I have :
> >
> >    * <div id="credit"></div>
> >
> >        * Because the style sheet does :
> >        * <div id="credit">
> >              o Credits calculation, but I have none...
> >        * </div>
> >
> >    * <div class="clear both">&nbsp;</div>
> >
> >        * Because the style sheet does :
> >        * <div class="clearboth">&#160;</div>
> >

Why is that happening in skins and not in views?

Maybe it is the sitemap.serializer.xhtml, because I just changed the
serializer to "html" and get:
<div class="test">&nbsp;</div>

That means we have to look into the xhtml serializer to get our &nbsp;.

> > This is not the same behavior :
> >
> >    * First, an empty div tag is kept with this form <div></div>
> >    * Second, the &#160; appears like &nbsp; in my source code which is
> >      what is expected (and not [Â ]).
> >
> I think I am the only one to have this problem since I am the only one 
> to participate to this thread ;-) .

Thx for ignoring me ;-)

> Anyway, here is what I think - When we put a hook in an *.fv file :
> 
>     * There is a css problem if the hook is transformed into an empty
>       <div/> tag when generating XHTML,
>     * There is also a problem when we add a blank (&#160;) because if
>       the defined style has a background color, the tag <div
>       ...>&#160;</div> appears in the page as a box with the background
>       color
> 
> So, the solution would be to skip the hook generation when the content 
> is empty.
> Something like :
> 
> |<xsl:choose>
>     <xsl:when test="normalize-space(.)">
>       ... Generation of div tag and content ...
>     </xsl:when>
>     <xsl:otherwise>
>       ... Skip the generation ...
>     </xsl:otherwise>
> </xsl:choose>|
> 
> But I don't know exactly where to put this control ?
> 

/home/thorsten/apache/forrest-trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/hooksMatcher.xsl

...but it is not that easy because normally you will have
<forrest:hook name="test">
  <forrest:contract name="testData"/>
</forrest:hook>

Now what you would have to do is to test whether the *transfomed*
presentation model of the contract (remember a contract is right now
only a xsl viewHelper template) will return something. You may test it
via a xsl:variable but I am not sure.

The hooksMatcher.xsl got imported in the prepare.xhtml.xsl all in the
internal view plugin.

HTH

salu2
thorsten


> Regards,
> Cyriaque,
> 
> >
> >
> > Cyriaque,
> >
> > Cyriaque Dupoirieux a écrit :
> >
> >> Thorsten Scherler a écrit :
> >>
> >>> On Fri, 2005-07-29 at 10:25 +0200, Cyriaque Dupoirieux wrote:
> >>>  
> >>>
> >>>> Ok, it works.
> >>>> The only thing is when I edit the XHTML source, I have this :
> >>>>
> >>>> <div class="clearboth">Â </div>
> >>>>
> >>>> It seams that &#160; is translated to  ?
> >>>> Why don't you use &#32; ?
> >>>>
> >>>>   
> >>>
> >>>
> >>>
> >>> http://www.html-world.de/program/html_sz.php
> >>>
> >>> It is in german, but you will understand. ;-)
> >>>
> >>> Did you try with &#32;? What is the outcome? I will try after work.

> >>
> >> It gives this :
> >>      <div class="clearboth" /> !
> >>
> >> So I prefer &#160; :-P
> >>
> >> You know, I don't really understand why browsers are disturbed by 
> >> empty <div/> tags.
> >> But it is a fact, and I have a proof !
> >>
> >> Have a look here : 
> >> http://cyriaque.dupoirieux.free.fr/testviews1/testDiv.html
> >>
> >> Regards,
> >> Cyriaque,
> >>
> >>> salu2
> >>>
> >>>  
> >>>
> >>>> Cordialement,
> >>>> Cyriaque,
> >>>>
> >>>> Thorsten Scherler a écrit :
> >>>>
> >>>>  
> >>>>
> >>>>> On Thu, 2005-07-28 at 18:08 +0200, Cyriaque Dupoirieux wrote:
> >>>>>
> >>>>>
> >>>>>    
> >>>>>
> >>>>>> Thorsten Scherler a écrit :
> >>>>>>  
> >>>>>>      
> >>>>>>
> >>>>>>>> in order to generate <div> </div> if nbsp='true'
instead of 
> >>>>>>>> <div/> which is not well interpreted by browsers.
> >>>>>>>> But this &#160; is not enough, the generation still
gives 
> >>>>>>>> <div/>...
> >>>>>>>>                
> >>>>>>>
> >>>>>>>
> >>>>>>> ¿?
> >>>>>>>
> >>>>>>> Are you sure? I tried it and is working fine for me.
> >>>>>>>
> >>>>>>>
> >>>>>>>            
> >>>>>>
> >>>>>>
> >>>>>> Actually, I don't understand what happens, if I write a trace
to 
> >>>>>> see if it's the good template which is used, the generation
is OK 
> >>>>>> because of my trace (the div tag is no more empty...)
> >>>>>> (It's a little bit like Heisenberg uncertainty principle, the

> >>>>>> observer disturb the result of the experiment :-) )
> >>>>>>
> >>>>>> Let it as it is I will continue my investigations, it may come

> >>>>>> from something else in my environment...
> >>>>>>
> >>>>>>  
> >>>>>>       
> >>>>>
> >>>>>
> >>>>> try a "forrest clean" in your project and build.sh clean in forrest.
> >>>>> As well I recommend to "ant clean" all view plugins.
> >>>>>
> >>>>> After a build everything should work fine.
> >>>>>
> >>>>>
> >>>>>
> >>>>>    
> >>>>>
> >>>>>>>           
> >>>>>>>
> >>>>>>>> I propose :
> >>>>>>>>     <xsl:if test="@nbsp='true'"><span/></xsl:if>
> >>>>>>>>
> >>>>>>>>  
> >>>>>>>>
> >>>>>>>>                
> >>>>>>>
> >>>>>>>
> >>>>>>> Hmm, I do not like that much because the <span/> do
not belong 
> >>>>>>> in there
> >>>>>>> IMO.
> >>>>>>>
> >>>>>>>
> >>>>>>>            
> >>>>>>
> >>>>>>
> >>>>>> Sure you are right...
> >>>>>> By the way, can you try to add something like this in your *.fv

> >>>>>> and tell me the result :
> >>>>>>
> >>>>>>       <forrest:hook nbsp="true" class="test"/>
> >>>>>>
> >>>>>>  
> >>>>>>       
> >>>>>
> >>>>>
> >>>>> <div class="test"> </div>
> >>>>>
> >>>>> HTH
> >>>>>
> >>>>> salu2
> >>>>> thorsten
> >>>>>
> >>>>>
> >>>>>
> >>>>>    
> >>>>>
> >>>>>> Regard,
> >>>>>> Cyriaque,
> >>>>>>
> >>>>>>  
> >>>>>>      
> >>>>>>
> >>>>>>> salu2
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>           
> >>>>>>>
> >>>>>>>> PS: Sorry, I have lost the thread...
> >>>>>>>>
> >>>>>>>>  
> >>>>>>>>
> >>>>>>>>                
> >>>>>>>
> >>>>>>>
> >>
> >>
> >
> >
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


Mime
View raw message