You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Diwaker Gupta <di...@apache.org> on 2005/08/07 09:41:14 UTC

using forrest:property in contracts head section

Hey everyone,

As my travails with the Google Maps contract continue, I came across the 
following problem.

Consider the following snippet from this hypothetical contract:

 <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
    format="xhtml" name="content-google-maps" inputFormat="xsl" body="true"
    head="true">
    <xsl:stylesheet version="1.1" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template name="content-google-maps-head">
          <xsl:param name="content-google-maps-key"/>
          <div><xsl:value-of select="$content-google-maps-key"/></div>
 </xsl:template>
        <xsl:template name="content-google-maps-body">
          <xsl:param name="content-google-maps-key"/>
          <div><xsl:value-of select="$content-google-maps-key"/></div>
 </xsl:template>
     </xsl:stylesheet>
  </forrest:template>

And now I try to use it in my view thus:
 <forrest:contract name="content-google-maps">
   <forrest:properties contract="content-google-maps">
     <forrest:property
      name="content-google-maps-key">your-key-here</forrest:property>
   </forrest:properties>
  </forrest:contract>

In the generated output, I see in the <head> section: (unexpected behavior)
<div></div>

But in the body section, I see in the <body> section: (expected behavior)
<div>your-key-here</div>

Any idea whats going on here?

Diwaker
-- 
Web/Blog/Gallery: http://floatingsun.net

Re: using forrest:property in contracts head section

Posted by Thorsten Scherler <th...@apache.org>.
I activated parsing properties as well for "head" templates in revision
231007. See diff for more detail.

HTH

On Sun, 2005-08-07 at 00:41 -0700, Diwaker Gupta wrote:
> Hey everyone,
> 
> As my travails with the Google Maps contract continue, I came across the 
> following problem.
> 
> Consider the following snippet from this hypothetical contract:
> 
>  <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
>     format="xhtml" name="content-google-maps" inputFormat="xsl" body="true"
>     head="true">
>     <xsl:stylesheet version="1.1" 
>         xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>  <xsl:template name="content-google-maps-head">
>           <xsl:param name="content-google-maps-key"/>
>           <div><xsl:value-of select="$content-google-maps-key"/></div>
>  </xsl:template>
>         <xsl:template name="content-google-maps-body">
>           <xsl:param name="content-google-maps-key"/>
>           <div><xsl:value-of select="$content-google-maps-key"/></div>
>  </xsl:template>
>      </xsl:stylesheet>
>   </forrest:template>
> 
> And now I try to use it in my view thus:
>  <forrest:contract name="content-google-maps">
>    <forrest:properties contract="content-google-maps">
>      <forrest:property
>       name="content-google-maps-key">your-key-here</forrest:property>
>    </forrest:properties>
>   </forrest:contract>
> 
> In the generated output, I see in the <head> section: (unexpected behavior)
> <div></div>
> 
> But in the body section, I see in the <body> section: (expected behavior)
> <div>your-key-here</div>
> 
> Any idea whats going on here?
> 
> Diwaker
-- 
thorsten

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