cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <newp...@poczta.gazeta.pl>
Subject using xsl:copy-of inside xsp:logic tag
Date Thu, 01 Jan 1970 00:00:00 GMT
In documentation of Cocoon (\docs\userdocs\xsp\logicsheet-
concepts.html) I found this sample code:

<xsl:template match="sql:create-connection">
<!-- *** Argument collection skipped for the sake of brevity *** -->
<xsp:logic>
  SQLHelper.createConnection(
    <xsl:copy-of select="$name"/>,
    <xsl:copy-of select="$connect-url"/>,
    <xsl:copy-of select="$user-name"/>,
    <xsl:copy-of select="$password"/>,
    request
  );
</xsp:logic>
</xsl:template>

However I was trying to find similar code in samples but I don&#8217;t 
see anything like this. In all samples code only xsp tags are used 
inside logic tag not standard xsl tags.

I&#8217;m try to do something similar. 
First I set XSL variable like this:
<xsl:variable name="loc-w"><xsl:value-of 
select="@w"/></xsl:variable>

and then try to use it to pass value to method in by helper class 
like above. 
I was also trying to write something like this:

String s = <xsl:copy-of select="$loc-w"/>;

In this case I get: Error compiling: incompatible types Line 0, 
column 0: 1 error

If I change it to: String s = (String) <xsl:copy-of select="$loc-
w"/>;
I get: Error compiling: inconvertible types Line 0, column 0: 1 
error

This code then translated to Java is changed to:
String s = (String) 
    xspAttr.addAttribute(
      "",
      "select",
      "select",
      "CDATA",
      "$loc-w"
    );

Of course it is wrong because addAttribute() "return" void.
But how was it possible that code in documentation was working? 

Maybe there is some syntax problem here which could be quickly 
pointed by some more advanced users?
If not maybe somebody know how to in logicsheet take some 
attributes of one XML tag, and pass them to Java class, or use in 
inline code of XSP page.

Thanks for any help or suggestions.

Best regards,
Arek



-------------------------------------


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message