I tried using XSLT result type but it forced me to have a stylesheet might be something i was doing wrong
but finally for XM i found that creating your own custom result type is the clean approach and it worked quite smoothly for me. -aum On Tue, Jan 20, 2009 at 9:55 AM, Miguel <miguel...@gmail.com> wrote: > The xslt result works fine, but you need to build the dom tree (using > dom, jdom, dom4j or anything that can "export" to w3 dom) and have it > in memory. I think Xstream also can "export" to w3 DOM. I´ve used > xstream and it works like a charm (in reflexion mode), but I don´t > know how to "customize" the xml it produces, and it´s pretty ugly. So > you may want to research how to create a custom mapping object <--> > xml . > One good thing about the xslt result type is that you don´t need to > have a stylesheet to do a null transformation!! (if you don't > configure a stylesheet you get a identity transform). > > Si quieres ser más positivo, pierde un electrón > Miguel Ruiz Velasco S. > > > > On Mon, Jan 19, 2009 at 21:11, dusty <dustin_pea...@yahoo.com> wrote: > > > > Has either of you tried the XSLT result type? I have not and I am > curious > > about how well it works. > > > > > > > > aum strut wrote: > >> > >> Thanks Musachy for the help > >> i will try to follow what u have suggested > >> > >> > >> > >> On 1/19/09, Musachy Barroso <musa...@gmail.com> wrote: > >>> > >>> Take a look at the results, they are pretty simple, this is > >>> StreamResult for example: > >>> > >>> > >>> > http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StreamResult.java?view=markup > >>> > >>> all you need to do is implement the Result interface, and then > >>> register the result in a package: > >>> > >>> <package name="struts-default" abstract="true"> > >>> <result-types> > >>> <result-type name="stream" > >>> class="org.apache.struts2.dispatcher.StreamResult"/> > >>> .... > >>> </result-types> > >>> ... > >>> > >>> and the result is ready to be used. > >>> musachy > >>> > >>> > >>> On Mon, Jan 19, 2009 at 11:40 AM, aum strut <aum.str...@gmail.com> > wrote: > >>> > Thats what i came up with.. > >>> > any one have any idea where i can find a good starter so that i can > >>> write > >>> my > >>> > own result type? > >>> > > >>> > thanks for the help Musachy > >>> > > >>> > On 1/19/09, Musachy Barroso <musa...@gmail.com> wrote: > >>> >> > >>> >> You could write your own result that uses XStream, or any other > >>> >> library to serialize the objects into xml. > >>> >> > >>> >> musachy > >>> >> > >>> >> On Mon, Jan 19, 2009 at 2:27 AM, aum strut <aum.str...@gmail.com> > >>> wrote: > >>> >> > Hi All, > >>> >> > > >>> >> > I developing ajax based application using struts 2.0.11 > >>> >> > for ajax we are using YUI for making ajax based call and currently > >>> its > >>> >> > working fine for me.For one case i need to send XML created in my > >>> >> business > >>> >> > logic to the front end > >>> >> > > >>> >> > The call will be created using YUI API and it must get XML which > is > >>> >> getting > >>> >> > created in Business logic in in order to fullfill its requirement. > >>> >> > > >>> >> > For experimentation i used the result type "Stream" and put the > >>> generated > >>> >> > XML in the buffer and it worked perfectly fine, but i think that > is > >>> not > >>> >> the > >>> >> > best approach. > >>> >> > > >>> >> > and due to the current project stage we can't migrate this to > higher > >>> >> > version, so the probability of using REST plugin or any other > option > >>> is > >>> >> not > >>> >> > there > >>> >> > > >>> >> > Can an one suggest me the best approach so that we can return XML > to > >>> the > >>> >> YUI > >>> >> > ajax call > >>> >> > > >>> >> > thanks in advance > >>> >> > -aum > >>> >> > > >>> >> > >>> >> > >>> >> > >>> >> -- > >>> >> "Hey you! Would you help me to carry the stone?" Pink Floyd > >>> >> > >>> >> > --------------------------------------------------------------------- > >>> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >>> >> For additional commands, e-mail: user-h...@struts.apache.org > >>> >> > >>> >> > >>> > > >>> > >>> > >>> > >>> -- > >>> "Hey you! Would you help me to carry the stone?" Pink Floyd > >>> > >>> --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >>> For additional commands, e-mail: user-h...@struts.apache.org > >>> > >>> > >> > >> > > > > -- > > View this message in context: > http://www.nabble.com/Sending-XML-data-from-action-to-YUI-tp21538031p21556256.html > > Sent from the Struts - User mailing list archive at Nabble.com. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >