cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorg Heymans>
Subject Re: How to pass an attaribute value from a resulting transformed xml
Date Thu, 10 Mar 2005 18:29:39 GMT
Thanks for making your situation a bit more clear.

I had a look at the docs to find a component that might suit your needs.

Have you tried using the WriteDomSessionTransformer [1]? I have never 
used it myself, but from the docs it seems like it could do the trick 
for you :

<map:transform type="writeDOMsession">
     <map:parameter name="dom-name" value="DBresult"/>
     <map:parameter name="dom-root-element" value="rowset"/>

Apparently, this transformer stores an object called "DBresult" in the 
session, the object contains the DOM representation of your pipeline 
encapsulated inside a root "rowset" element.

Inside the action that sets the response header you could fetch this 
object, do some DOM searching until you find the title and voila!


[1] wrote:
> Hi,
> I apologize for the previous unformatted mail.  some how it was corrupted.
> I am resendign this for readability.
> This is the step-by-step process I am following.
> We have a content management server. Users upload all the documents,
> reports etcto this server. All the realted documents are stored/grouped
> under one documentID.
> In the intranet portal, when the users search for a particular documentID,
> they get some search results. ifthe user clicks on any link it opens the
> summary of that document giving links to download each attachment or all
> the attachments in a zip format (with name of the zip file as
> <DocumentID_<Title>.zip).
> we have site map in which when the user clicks on the download button,
> which ends with a pattern
> http://servername:port/<access_to_the_document>/<documentID>?view=download,
> my pipeline in the sitemap will be invoked.
> In that pipeline, I execute <map:aggregate> to get the document summary
> xml. Then I will transform that xml to another xml which has required
> format to use ZipArchiveSerialzer as shown below:
> <?xml version="1.0" encoding="UTF-8"?>
> <zip:archive xmlns:zip=""
> title="">
> <zip:entry name="xyz.ppt" src="soemURL"/>
> <zip:entry name="abc.pdf" src="someURL"/>
> </zip:archive>
> After getting this xml on-fly from the transformer, I will call <map:call
> resource="someresource"> . In that resource, I call an action which sets
> the
> response.setHeader("content-disposition","attachment;filename="+myfilename);
> This "myfilename" is supposed to be the title attribute in the above on-fly
> generated  zip-archive xml. So, now my problem is, how can I get this
> title?
> Is there any other way where I can send this title as parameter from my
> transformer?
> Please guide me.
> Thanks & Regards,
> Murthy
> Notice: The information contained in this e-mail message and/or attachments to it may
contain confidential or privileged information.   If you are not the intended recipient, any
dissemination, use, review, distribution, printing or copying of the information contained
in this e-mail message and/or attachments to it are strictly prohibited.   If you have received
this communication in error, please notify us by reply e-mail or telephone and immediately
and permanently delete the message and any attachments.  Thank you

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message