cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobia <>
Subject Re: Tuning XSP output
Date Tue, 20 Mar 2007 10:20:02 GMT
Richard Lewis wrote:
> 1) Stop it from producing empty elements.
> <duration><esql:get-string column="duration" /></duration>

I guess you need to put it inside a Java if statement.
You can wrap it all in a logicsheet, for convenience:

	<my:get-element column="duration"/>

Something like this (untested):

	<xsl:template match="my:get-element">
	    if (<esql:get-string column="{@column}"/>.length() > 0) {
	      <xsl:element name="{@column}">
	        <esql:get-string column="{@column}"/>

> 2) Some of my fields (e.g. biography) are long textual fields which
> include line spaces. Is there a way to capture those lines and wrap
> them up in elements?

Again untested:

	String biography = <esql:get-string column="biography"/>;
	for (String para : biography.split("\\n\\s*\\n")) {

All the other methods I can think of are less reliable, less performant
and much more lenghty.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message