You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stefan Pietschmann <sp...@inf.tu-dresden.de> on 2004/01/22 08:34:35 UTC
[SOLVED] use parameter from sitemap in java transformer
Works now.
Thanx again for your help :)
Stefan
> -----Ursprüngliche Nachricht-----
> Von: m_rolappe@web.de [mailto:m_rolappe@web.de]
> Gesendet: Mittwoch, 21. Januar 2004 23:12
> An: users@cocoon.apache.org
> Betreff: AW: use parameter from sitemap in java transformer
>
> from the facts given I suspect that you didn't correctly override the
> setup
> method. check carefully that the method signature is correct; check your
> imports (e.g. you might have imported excalibur's SourceResolver instead
> of
> cocoon's).
>
> > -----Ursprüngliche Nachricht-----
> > Von: users-return-61680-m_rolappe=web.de@cocoon.apache.org
> > [mailto:users-return-61680-m_rolappe=web.de@cocoon.apache.org]Im Auftrag
> > von Stefan Pietschmann
> > Gesendet: Mittwoch, 21. Januar 2004 21:46
> > An: users@cocoon.apache.org
> > Betreff: AW: AW: AW: use parameter from sitemap in java transformer
> >
> >
> > Hi again,
> >
> > Below you can see what's in my sitemap an in the transformer
> > currently. The
> > transformer is still working fine, the parameter not. With some
> > system.out's
> > I've found out, that it doesn't seem to go into the if-loop in
> > setup(). When
> > I try a system.out.println(par.toString()) it doesn't give me anything,
> so
> > it seems to me the parameter isn't passed to the setup method.
> > Anything I need to specify in the sitemap perhaps to make my transformer
> > work with parameters?
> >
> > Oh, and thanks a lot for your help so far ;)
> > stefan
> >
> >
> > <map:transformer name="addLinks"
> > src="de.amacont.dom.transformation.LinkTransformer"/>
> > ...
> > ...
> > <map:transform type="addLinks">
> > <map:parameter name="componentTag" value="comp"/>
> > </map:transform>
> >
> > -----------------------
> >
> > public class LinkTransformer extends AbstractDOMTransformer {
> > ...
> > private String COMP_TAG = "span";
> > ...
> >
> > public void setup(...)throws ProcessingException, SAXException,
> > IOException{
> >
> > if (par.isParameter("componentTag")) {
> > try {
> > this.COMP_TAG = par.getParameter("componentTag");
> > }
> > catch (ParameterException pe) {...}
> > }
> > }
> >
> > public Document transform(Document docu) { .....}
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org