Hi Richard,

a few years ago, I developed an application using Cocoon-2.0.4 and XSP stylesheets. One good way to find out what went wrong was looking at the Java source file which is generated from an XSP stylesheet. There, you will certainly be able to see why "p cannot be resolved".

HTH

Armin

Richard Lewis wrote:

On Thursday 22 March 2007 15:52, Richard Lewis wrote:
On Tuesday 20 March 2007 10:20, Tobia wrote:
Richard Lewis wrote:
1) Stop it from producing empty elements.
<duration><esql:get-string column="duration" /></duration>
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")) {
          <l><xsp:expr>para</xsp:expr></l>
        }
Thanks for these pointers. I'm quite new to XSP and logicsheets and I'm now
having trouble getting them to work.

Does anyone have any ideas why my logicsheet won't work?

OK, I'm still not having any success with this logicsheet. At the moment I'm just transforming my XSP with my logicsheet XSLT, storing the result and using that in my sitemap rather than the original XSP.

This lead me to discover that I get file not found exceptions when the xmlns:sara namespace is in the generated XSP. Might this be a problem?

I've also found another problem with my XSP that I can't seem to fix. My logicshhet contains the following (slightly altered from previous post):

<xsl:template match="sara:get-string">
 <xsl:if test="@exclude-values">
   <xsp:logic>
String <xsl:value-of select="@column" />_exclude[] = "<xsl:value-of select="@exclude-values" />".split("\\s+");
   </xsp:logic>
 </xsl:if>
 <xsp:logic>
String _<xsl:value-of select="@column" /> = <esql:get-string column="[EMAIL PROTECTED]" />;
   if (_<xsl:value-of select="@column" />.length() > 0) {
   <xsl:element name="[EMAIL PROTECTED]">
     for (String p : _<xsl:value-of select="@column" />.split("\\n")) {
     <l><xsp:expr>p</xsp:expr></l>
     }
   </xsl:element>
   }
 </xsp:logic>
</xsl:template>

I get error messages in the for loop saying that "p cannot be resolved":

org.apache.cocoon.components.language.LanguageException: Error compiling expand_artist2xml_xsp:
ERROR 1 (org/apache/cocoon/www/sara/maps/expand_artist2xml_xsp.java):
...
);

// start error (lines 438-438) "p cannot be resolved"
XSPObjectHelper.xspExpr(contentHandler, p);

// end error
_endElem(
"",

I tried altering the logicsheet so that all the "p"s had unique names but it gave the same error.

Any ideas how I fix this?

Cheers,
Richard


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to