You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Kröpfl <pe...@groebi.com> on 2004/06/02 00:35:06 UTC

Multiple attributes with xsp:attribute xsp:param (2)

<a href=" skilehrer/start " class="textlink">
<i18n:text i18n:key=" page.category.skilehrer ">skilehrer</i18n:text>
</a>


This ist the code generated by:

<link>
<xsp:attribute name="href">
							<esql:get-string column="NAME"/>/start
						</xsp:attribute>
						<xsp:attribute name="id">
							page.category.<esql:get-string column="NAME"/>
						</xsp:attribute>
						<esql:get-string column="NAME"/>
					</link>


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


[solved]

Posted by Peter Kröpfl <pe...@groebi.com>.
Thanks to Carlos and Jörg.
You really helped a lot, not only technically, but also psychologically. ;-)

peter


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


Re: i18n-key problem

Posted by Joerg Heinicke <jo...@gmx.de>.
On 02.06.2004 00:51, Peter Kröpfl wrote:

> <a href=" snowboarder/start " class="textlink">
> <i18n:text i18n:key=" page.category.snowboarder "> snowboarder </i18n:text>
> </a>
> ---
> 
> With this code the i18n fails.

Ah, now I get confirmed what I already guessed :)

> i guess the spaces before and after the i18n-key is are to blame for that.

Indeed.

> I cannot figure out why these spaces appear.

That's simple:

 >  <xsp:attribute name="href">
 >   <esql:get-string column="NAME"/>/start
 >  </xsp:attribute>

Before the esql:get-string element you have a line break and spaces and 
the text node "/start" also does not end at the 't' but with a line 
break and the space(s) infront of </xsp:attribute>. You can either write 
it all in one line:

<xsp:attribute name="href"><esql:get-string 
column="NAME"/>/start</xsp:attribute>

or fix it in the stylesheet using normalize-space() that removes leading 
and trailing white spaces.

Joerg

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


i18n-key problem

Posted by Peter Kröpfl <pe...@groebi.com>.
sorry, 'bout the Mulitple...(2) - posting
hit post-button by accident...
------------------------------------------------



---
<a href=" snowboarder/start " class="textlink">
<i18n:text i18n:key=" page.category.snowboarder "> snowboarder </i18n:text>
</a>
---

With this code the i18n fails.
i guess the spaces before and after the i18n-key is are to blame for that.

I cannot figure out why these spaces appear.



Code Snips, that generate the code above:
---
<link>
 <xsp:attribute name="href">
  <esql:get-string column="NAME"/>/start
 </xsp:attribute>
 <xsp:attribute name="id">
  page.category.<esql:get-string column="NAME"/>
 </xsp:attribute>
 <esql:get-string column="NAME"/>
</link>
---

and


---
<xsl:template match="link">
 <a class="textlink" href="{@href}">
  <i18n:text i18n:key="{@id}"> <xsl:apply-templates/> </i18n:text>
 </a> 
</xsl:template>
---



ps: thanks to jörg and carlos :-)
as you can see i changed my code.
multiple attributes are possible now.

peter


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


Re: Multiple attributes with xsp:attribute xsp:param (2)

Posted by Joerg Heinicke <jo...@gmx.de>.
Hello Peter,

hmm, ok, all the stuff is a bit confusing, but my guess is now that it 
is indeed an error in your XSLT.

Your sitemap looks similar to the following:

<map:generate type="serverpages" src="..."/>
<map:transform type="xslt" src="..."/>
<map:transform type="i18n"/>
<map:serialize type="html"/>

You sent the XSP and parts of your stylesheet. Both work as I would 
expect it from the code:

> <a href=" skilehrer/start " class="textlink">
> <i18n:text i18n:key=" page.category.skilehrer ">skilehrer</i18n:text>
> </a>

The only problem is does not work as you expect it. You only did not 
tell us what exactly does not work. The replacement of "skilehrer" with 
it's i18n value? From what I see it's just a problem of the additional 
spaces in the i18n:key attribute. So you can rewrite your stylesheet to

<xsl:template match="link">
   <a class="textlink" href="{normalize-space(@href)}">
     <i18n:text i18n:key="{normalize-space(@id)}"/>
   </a>
</xsl:template>

and it should work - if this was the problem.

Joerg

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