You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nicolas Maisonneuve <n....@hotPop.com> on 2003/09/30 18:54:44 UTC
XSP function java with xsp:content error
hy , i would like create a function like:
<xsp:page>
<xsp:logic>
String text="coco"
public void addXml() {
<xsp:content><hy><xsp:attribute name="coucou"><xsp:expr>text</xsp:expr></xsp:attribute></hy></xsp:content>
}
}
<page>
</page>
</xsp:logic>
</xsp:page>
but there is a exception :
start error (lines 92-92) "xspAttr cannot be resolved"
xspAttr.addAttribute(
when i look the generated java code, the xspAttr = new AttributImp(); is in the generate() function but not in my function
someone can me help ?
thanks in advance :-)
nico
Re: XSP function java with xsp:content error
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Nicolas Maisonneuve wrote:
> hy , i would like create a function like:
> <xsp:page>
> <xsp:logic>
> String text="coco"
> public void addXml() {
> <xsp:content><hy><xsp:attribute
> name="coucou"><xsp:expr>text</xsp:expr></xsp:attribute></hy></xsp:content>
> }
> }
> <page>
> </page>
> </xsp:logic>
> </xsp:page>
> but there is a exception :
>
> start error (lines 92-92) "xspAttr cannot be resolved"
> xspAttr.addAttribute(
> when i look the generated java code, the xspAttr = new AttributImp();
> is in the generate() function but not in my function
>
> someone can me help ?
This is because the generated code relies on the xspAttr local to be
present. So you need either to declare your own in addXml() or transmit
the one declared in generate() as a paremeter of addXml(AttributesImpl
xspAttr).
BTW, <xsp:content> is useless.
Sylvain
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance - http://www.orixo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org