cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Man <Martin....@seznam.cz>
Subject Re: <xsl:template name="value-for-..."> buggy ??
Date Wed, 17 Oct 2001 06:37:18 GMT
On Wed, Oct 17, 2001 at 07:53:12AM +0200, Sylvain Wallez wrote:
> 
> 
> Martin Man a écrit :
> > 
> > hi team,
> >         when looking around several logicsheets I found this code
> > 
> >   <xsl:template name="value-for-name">
> >     <xsl:choose>
> >       <xsl:when test="@name">"<xsl:value-of select="@name"/>"</xsl:when>
> > 
> >       <xsl:when test="name">
> >                       ^^^^
> > 
> >         <xsl:call-template name="get-nested-content">
> >           <xsl:with-param name="content" select="xsp-request:name"/>
> >                                                  ^^^^^^^^^^^^^^^^
> > 
> >         </xsl:call-template>
> >       </xsl:when>
> >     </xsl:choose>
> >   </xsl:template>
> > 
> > don't you think it will not work at all ??? (tho, me not a namespace guru :-()
> > 
> > rgds,
> > martin
> > 
> > P.S. i'm willing to fix them all, just to be sure i'll not break anything
> > 
> 
> I'm afraid you will ;)
> 
> This kind of templates allow for a dual notation of logicsheet tag
> parameters : either as attribute for constant values of as child element
> for dynamic values.

sure I know all this, the keypoint was that attributes work correctly, but
when child node is present there are constructs like

> >       <xsl:when test="@name">"<xsl:value-of select="@name"/>"</xsl:when>
ok, this one catches attribute, no problem here...

> >       <xsl:when test="name">
> >                       ^^^^
this one is testing presence of child element called name (IMO wrong test,
should test for xsp-request:name)

> >         <xsl:call-template name="get-nested-content">
> >           <xsl:with-param name="content" select="xsp-request:name"/>
> >                                                  ^^^^^^^^^^^^^^^^
and here we invoke the template get-nested-content, *but* with select for
xsp-request:name, ....
> > 
> >         </xsl:call-template>

see my point ???

> 
> Sylvain.
> -- 
> Sylvain Wallez
> Anyware Technologies - http://www.anyware-tech.com
> 

cau,
martin

-- 
2CC0 4AF6 92DA 5CBF 5F09  7BCB 6202 7024 6E06 0223

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message