Hi Robert,
Thank you for the reply.Yes i am using Struts.I am
getting output as Document object from the action class.Now i want
to process that DOM object with XSL.From cocoon examples, which i
got ,all the input values are pre defined as pipline, but my case the
generator source as Dynamic, so i am looking for the solution. I will
try your suggesttion and let you know the result.
Thanks -
Siva
On Wed, 5 Jan 2005 08:46:34 +1030, Connell, Robert (SAPOL)
<[EMAIL PROTECTED]> wrote:
> Siva,
>
> Are you using Struts Actions (I presume so)?
>
> When you say you are getting XML output from the action class what is
> being produced i.e. file or Object within the session etc ?
>
> We are not using Struts currently but we were previously.
>
> What we do is have an ActionBean (similar to ActionForm) per Action (Cocoon
> Action in our case) which contains data that we want to "XMLize". This
> ActionBean extends a generic ActionBean which has a toSAX method in it. The
> generic toSAX method invokes a CreateXML method in our specific ActionBean
> to create specific XML for that Action
>
> In Generic ActionBean....
>
> public final void toSAX(ContentHandler contentHandler) throws SAXException {
> initRoot();
> createXML(rootElement);
> rootElement.toSAX(contentHandler);
> }
>
> In Specific ActionBean....
>
> public void createXML(XMLElement rootElement) throws SAXException {
>
> rootElement.createXMLElement("userId", this.getUserId());
> }
>
> In Sitemap we have ....
>
> <map:generators default="file">
>
> ...........
> <map:generator name="session-attr"
> src="org.apache.cocoon.generation.SessionAttributeGenerator"/>
> </map:generators>
>
> and then ...
>
> <map:match pattern="partLogin">
> <map:generate type="session-attr" src="{global:LOGIN_ACTION_BEAN}"/>
>
> <map:serialize type="xml"/>
> </map:match>
>
> Therefore what happens when the entry in the sitemap matches is that it will
> invoke the SessionAttributeGenerator with the parameter of the Actionbean
> that we stored in the session. The SessionAttributeGenerator invokes the
> toSAX method in that Bean which will create a SaxEvent which subsequently
> gets serialized to XML in the sitemap.
>
> Robert
>
> -----Original Message-----
> From: Siva [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 4 January 2005 5:12 PM
> To: [email protected]
> Subject: Struts with cocoon problem
>
> Hi ,
> I am new to cocoon and I am using cocoon with struts using
> Struts- cocoon plugin.In this, i am getting XML output from the action
> class(making form bean,request and session objects as XML),now I want
> to process that XML with xsl using cocoon pipeline.I don't know how to
> pass the dom object into the pipline dynamically.I do not want to pass
> my xsl to generator, instead i want to pass the the XML to sitemap
> something like this
>
> <map:match pattern="jsptopdf/pageOneJSP">
> <map:generate type="***DYNAMIC DOM OBJECT?????" />
> <map:transform src="context://fancy/fancy.xsl"/>
> <map:serialize type="html"/>
> </map:match>
>
> Is it possible??...Could you please suggest me the correct way of solving
> this..
>
> Thanks -
> Siva
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]