You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by "Gav...." <br...@brightontown.com.au> on 2006/01/22 14:38:52 UTC

Re: Best way to add repeatable code in v2/v3 (was Re: Example usecase)

----- Original Message ----- 
From: "Thorsten Scherler" <th...@apache.org>
To: <de...@forrest.apache.org>
Sent: Sunday, January 22, 2006 9:26 PM
Subject: Re: Best way to add repeatable code in v2/v3 (was Re: Example 
usecase)


| El dom, 22-01-2006 a las 21:09 +0800, Gav.... escribió:
| ...
| > |
| > | > P.S-
| > | >
| > | > Creating an empty hook has the side effect of a self closing div -
| > obviously
| > | > inlvalid and messes
| > | > up the rest of the page.
| > |
| > | Raise an issue (if there isn't one already, this is ringing a bell
| > | somewhere in the deep recesses of my mind).
| >
| > I will raise an issue, I had a good look for one but could not
| > find a relevent one.
|
| Hmm, did you read the other mail I wrote?

Yes, I posted this earlier than that one arrived though.

|
| 
forrest-trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.structurer/resources/stylesheets/hooksMatcher.xsl
| ...
| <xsl:if test="@nbsp='true'">&#160;</xsl:if>
| ...
|
| Meaning
| <forrest:hook name="headlines"></forrest:hook>
| creates
| <div id="headlines />
|
| and <forrest:hook name="headlines" nbsp="true"></forrest:hook>
| gives
| <div id="headlines"> </div>
|
| We need to document this in the howto, but self enclosing divs are
| default in the dispatcher, no bug!

Thats fine, I will send in a patch to document this. I can not really
think of a situation (except in testing) where I would want an
empty div anyway, but came across it so mentioned it.

I did see the resolution you mention in the whiteboard and on list [1]
but wasn't sure of the final outcome.

Thanks. Now if you could point me in the right direction regarding
the subject title ;>)

[1] - 
http://mail-archives.apache.org/mod_mbox/forrest-dev/200507.mbox/%3C42EA35BD.5080008@pcotech.fr%3E

Gav...

|
| salu2
| -- 
| thorsten
|
| "Together we stand, divided we fall!"
| Hey you (Pink Floyd)
|
|
|
|
| -- 
| No virus found in this incoming message.
| Checked by AVG Free Edition.
| Version: 7.1.375 / Virus Database: 267.14.21/236 - Release Date: 
20/01/2006
|
| 



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.21/236 - Release Date: 20/01/2006



Re: Best way to add repeatable code in v2/v3 (was Re: Exampleusecase)

Posted by "Gav...." <br...@brightontown.com.au>.
----- Original Message ----- 
From: "Thorsten Scherler" <th...@apache.org>
To: <de...@forrest.apache.org>
Sent: Sunday, January 22, 2006 9:56 PM
Subject: Re: Best way to add repeatable code in v2/v3 (was Re: 
Exampleusecase)


| El dom, 22-01-2006 a las 21:38 +0800, Gav.... escribió:
| > ----- Original Message ----- 
| > From: "Thorsten Scherler" <th...@apache.org>
| > To: <de...@forrest.apache.org>
| > Sent: Sunday, January 22, 2006 9:26 PM
| > Subject: Re: Best way to add repeatable code in v2/v3 (was Re: Example
| > usecase)
| >
| >
| > | El dom, 22-01-2006 a las 21:09 +0800, Gav.... escribió:
| > | ...
| > | > |
| > | > | > P.S-
| > | > | >
| > | > | > Creating an empty hook has the side effect of a self closing 
div -
| > | > obviously
| > | > | > inlvalid and messes
| > | > | > up the rest of the page.
| > | > |
| > | > | Raise an issue (if there isn't one already, this is ringing a bell
| > | > | somewhere in the deep recesses of my mind).
| > | >
| > | > I will raise an issue, I had a good look for one but could not
| > | > find a relevent one.
| > |
| > | Hmm, did you read the other mail I wrote?
| >
| > Yes, I posted this earlier than that one arrived though.
| >
| > |
| > |
| > 
forrest-trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.structurer/resources/stylesheets/hooksMatcher.xsl
| > | ...
| > | <xsl:if test="@nbsp='true'">&#160;</xsl:if>
| > | ...
| > |
| > | Meaning
| > | <forrest:hook name="headlines"></forrest:hook>
| > | creates
| > | <div id="headlines />
| > |
| > | and <forrest:hook name="headlines" nbsp="true"></forrest:hook>
| > | gives
| > | <div id="headlines"> </div>
| > |
| > | We need to document this in the howto, but self enclosing divs are
| > | default in the dispatcher, no bug!
| >
| > Thats fine, I will send in a patch to document this. I can not really
| > think of a situation (except in testing) where I would want an
| > empty div anyway, but came across it so mentioned it.
|
| Actually since Cyriaque and yourself seem to prefer that the default
| behavior would be non enclosing divs we can change the default
| behavior.
|
| wdyt?

Personally I think it wise to do so, especially if we are aiming to
adhere to W3C XHTML2 standards, where this is a must.
There are certain elements thsat can self close, <separator /> etc
but div is not one of them.

In the hooksMatcher.xsl, would you change true to false then?

Thanks

Gav...

|
| >
| > I did see the resolution you mention in the whiteboard and on list [1]
| > but wasn't sure of the final outcome.
| >
| > Thanks. Now if you could point me in the right direction regarding
| > the subject title ;>)
|
| jeje, yeah, after I fixed the httpd bug on lenya.zones.
|
| salu2
|
| >
| > [1] -
| > 
http://mail-archives.apache.org/mod_mbox/forrest-dev/200507.mbox/%3C42EA35BD.5080008@pcotech.fr%3E
| >
| > Gav...
| >
| > |
| > | salu2
| > | -- 
| > | thorsten
| > |
| > | "Together we stand, divided we fall!"
| > | Hey you (Pink Floyd)
| > |
| > |
| > |
| > |
| > | -- 
| > | No virus found in this incoming message.
| > | Checked by AVG Free Edition.
| > | Version: 7.1.375 / Virus Database: 267.14.21/236 - Release Date:
| > 20/01/2006
| > |
| > |
| >
| >
| >
| -- 
| thorsten
|
| "Together we stand, divided we fall!"
| Hey you (Pink Floyd)
|
|
|
|
| -- 
| No virus found in this incoming message.
| Checked by AVG Free Edition.
| Version: 7.1.375 / Virus Database: 267.14.21/236 - Release Date: 
20/01/2006
|
| 



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.21/236 - Release Date: 20/01/2006



Re: Best way to add repeatable code in v2/v3 (was Re:Exampleusecase)

Posted by "Gav...." <br...@brightontown.com.au>.
----- Original Message ----- 
From: "Thorsten Scherler" <th...@wyona.com>
To: <de...@forrest.apache.org>
Sent: Friday, January 27, 2006 8:24 PM
Subject: Re: Best way to add repeatable code in v2/v3 (was 
Re:Exampleusecase)


| El vie, 27-01-2006 a las 17:59 +0800, Gav.... escribió:
| > ----- Original Message ----- 
|
| ...
| > |
| > | Actually since Cyriaque and yourself seem to prefer that the default
| > | behavior would be non enclosing divs we can change the default
| > | behavior.
| > |
| > | wdyt?
| >
| > I have found another reason why it is best to close these divs properly.
| >
| > e.g.
| >
| >  <forrest:contract name="content-abstract">
| >             <forrest:properties contract="content-abstract">
| >               <forrest:property name="content-abstract"
| > nugget="get.abstract">
| >                 <jx:import
| > uri="cocoon://#{$cocoon/parameters/getRequest}.abstract.xml"/>
| >               </forrest:property>
| >             </forrest:properties>
| >  </forrest:contract>
| >
| > If there is content to return into this content-abstract request then 
that
| > is fine, on pages where there may not be any content available to 
return,
| > then the contract is blank. This creates a <div class="abstract" /> . It 
so
| > happens that most style sheets I looked at give the abstract div an 
'italic'
| > font-style. Because the div is not closed properly, the rest of the 
content
| > (content-main, content-minitoc-area etc.. ) that follows this 
self-closed
| > div are also outputting the 'italic' font-style.
| >
| > I looked for ages as to why my main content was italic, its because I 
have
| > no abtract-content in the xml source to give.
| >
| > I suppose one has to decide to either use a contract like this for all 
pages
| > or for none.
|
| Why not check whether there is an abstract and if not omit the div?
| <xsl:if test="$content-abstract/div[@class='abstract']/*">
| <xsl:copy-of
|          select="$content-abstract/div[@class='abstract']"/>
| </xsl:if>

You see, this is where I am still catching up with XSL, I didn't think
of solving it that way. Thanks. For the time being though, I moved
my abstract and am using it for something else at the moment. It might
be good to inlcude it somewhere as a commented out example.
Where should it go as an example ?

Gav...

|
| salu2
| -- 
| Thorsten Scherler
| COO Spain
| Wyona Inc.  -  Open Source Content Management  -  Apache Lenya
| http://www.wyona.com                   http://lenya.apache.org
| thorsten.scherler@wyona.com                thorsten@apache.org
|
|
|
|
| -- 
| No virus found in this incoming message.
| Checked by AVG Free Edition.
| Version: 7.1.375 / Virus Database: 267.14.23/242 - Release Date: 
26/01/2006
|
| 



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 27/01/2006



Re: Best way to add repeatable code in v2/v3 (was Re: Exampleusecase)

Posted by Thorsten Scherler <th...@wyona.com>.
El vie, 27-01-2006 a las 17:59 +0800, Gav.... escribió:
> ----- Original Message ----- 

...
> |
> | Actually since Cyriaque and yourself seem to prefer that the default
> | behavior would be non enclosing divs we can change the default
> | behavior.
> |
> | wdyt?
> 
> I have found another reason why it is best to close these divs properly.
> 
> e.g.
> 
>  <forrest:contract name="content-abstract">
>             <forrest:properties contract="content-abstract">
>               <forrest:property name="content-abstract" 
> nugget="get.abstract">
>                 <jx:import 
> uri="cocoon://#{$cocoon/parameters/getRequest}.abstract.xml"/>
>               </forrest:property>
>             </forrest:properties>
>  </forrest:contract>
> 
> If there is content to return into this content-abstract request then that 
> is fine, on pages where there may not be any content available to return, 
> then the contract is blank. This creates a <div class="abstract" /> . It so 
> happens that most style sheets I looked at give the abstract div an 'italic' 
> font-style. Because the div is not closed properly, the rest of the content 
> (content-main, content-minitoc-area etc.. ) that follows this self-closed 
> div are also outputting the 'italic' font-style.
> 
> I looked for ages as to why my main content was italic, its because I have 
> no abtract-content in the xml source to give.
> 
> I suppose one has to decide to either use a contract like this for all pages 
> or for none.

Why not check whether there is an abstract and if not omit the div?
<xsl:if test="$content-abstract/div[@class='abstract']/*">
 <xsl:copy-of 
          select="$content-abstract/div[@class='abstract']"/>
</xsl:if>

salu2
-- 
Thorsten Scherler
COO Spain
Wyona Inc.  -  Open Source Content Management  -  Apache Lenya
http://www.wyona.com                   http://lenya.apache.org
thorsten.scherler@wyona.com                thorsten@apache.org


Re: Best way to add repeatable code in v2/v3 (was Re: Exampleusecase)

Posted by "Gav...." <br...@brightontown.com.au>.
----- Original Message ----- 
From: "Thorsten Scherler" <th...@apache.org>
To: <de...@forrest.apache.org>
Sent: Sunday, January 22, 2006 9:56 PM
Subject: Re: Best way to add repeatable code in v2/v3 (was Re: 
Exampleusecase)

<snip >

| > | <forrest:hook name="headlines"></forrest:hook>
| > | creates
| > | <div id="headlines />
| > |
| > | and <forrest:hook name="headlines" nbsp="true"></forrest:hook>
| > | gives
| > | <div id="headlines"> </div>
| > |
| > | We need to document this in the howto, but self enclosing divs are
| > | default in the dispatcher, no bug!
| >
| > Thats fine, I will send in a patch to document this. I can not really
| > think of a situation (except in testing) where I would want an
| > empty div anyway, but came across it so mentioned it.
|
| Actually since Cyriaque and yourself seem to prefer that the default
| behavior would be non enclosing divs we can change the default
| behavior.
|
| wdyt?

I have found another reason why it is best to close these divs properly.

e.g.

 <forrest:contract name="content-abstract">
            <forrest:properties contract="content-abstract">
              <forrest:property name="content-abstract" 
nugget="get.abstract">
                <jx:import 
uri="cocoon://#{$cocoon/parameters/getRequest}.abstract.xml"/>
              </forrest:property>
            </forrest:properties>
 </forrest:contract>

If there is content to return into this content-abstract request then that 
is fine, on pages where there may not be any content available to return, 
then the contract is blank. This creates a <div class="abstract" /> . It so 
happens that most style sheets I looked at give the abstract div an 'italic' 
font-style. Because the div is not closed properly, the rest of the content 
(content-main, content-minitoc-area etc.. ) that follows this self-closed 
div are also outputting the 'italic' font-style.

I looked for ages as to why my main content was italic, its because I have 
no abtract-content in the xml source to give.

I suppose one has to decide to either use a contract like this for all pages 
or for none.

Gav... 



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.23/242 - Release Date: 26/01/2006



Re: Best way to add repeatable code in v2/v3 (was Re: Example usecase)

Posted by Thorsten Scherler <th...@apache.org>.
El dom, 22-01-2006 a las 21:38 +0800, Gav.... escribió:
> ----- Original Message ----- 
> From: "Thorsten Scherler" <th...@apache.org>
> To: <de...@forrest.apache.org>
> Sent: Sunday, January 22, 2006 9:26 PM
> Subject: Re: Best way to add repeatable code in v2/v3 (was Re: Example 
> usecase)
> 
> 
> | El dom, 22-01-2006 a las 21:09 +0800, Gav.... escribió:
> | ...
> | > |
> | > | > P.S-
> | > | >
> | > | > Creating an empty hook has the side effect of a self closing div -
> | > obviously
> | > | > inlvalid and messes
> | > | > up the rest of the page.
> | > |
> | > | Raise an issue (if there isn't one already, this is ringing a bell
> | > | somewhere in the deep recesses of my mind).
> | >
> | > I will raise an issue, I had a good look for one but could not
> | > find a relevent one.
> |
> | Hmm, did you read the other mail I wrote?
> 
> Yes, I posted this earlier than that one arrived though.
> 
> |
> | 
> forrest-trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.structurer/resources/stylesheets/hooksMatcher.xsl
> | ...
> | <xsl:if test="@nbsp='true'">&#160;</xsl:if>
> | ...
> |
> | Meaning
> | <forrest:hook name="headlines"></forrest:hook>
> | creates
> | <div id="headlines />
> |
> | and <forrest:hook name="headlines" nbsp="true"></forrest:hook>
> | gives
> | <div id="headlines"> </div>
> |
> | We need to document this in the howto, but self enclosing divs are
> | default in the dispatcher, no bug!
> 
> Thats fine, I will send in a patch to document this. I can not really
> think of a situation (except in testing) where I would want an
> empty div anyway, but came across it so mentioned it.

Actually since Cyriaque and yourself seem to prefer that the default
behavior would be non enclosing divs we can change the default
behavior. 

wdyt?

> 
> I did see the resolution you mention in the whiteboard and on list [1]
> but wasn't sure of the final outcome.
> 
> Thanks. Now if you could point me in the right direction regarding
> the subject title ;>)

jeje, yeah, after I fixed the httpd bug on lenya.zones. 

salu2

> 
> [1] - 
> http://mail-archives.apache.org/mod_mbox/forrest-dev/200507.mbox/%3C42EA35BD.5080008@pcotech.fr%3E
> 
> Gav...
> 
> |
> | salu2
> | -- 
> | thorsten
> |
> | "Together we stand, divided we fall!"
> | Hey you (Pink Floyd)
> |
> |
> |
> |
> | -- 
> | No virus found in this incoming message.
> | Checked by AVG Free Edition.
> | Version: 7.1.375 / Virus Database: 267.14.21/236 - Release Date: 
> 20/01/2006
> |
> | 
> 
> 
> 
-- 
thorsten

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