You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Jeudy, Guillaume" <gj...@teksystems.com> on 2009/04/28 18:51:16 UTC

Transform XML using Freemarker from an OMElement

Hi,
 
I'm using Axis2 client stubs generated by wdsl2java tool. It works great but the WSDL file i'm using doesn't define everything so I get OMElements that are in free form on service method response objects. What I want to do is transform an OMElement tree into another XML representation.
 
Are there any recommended ways of doing this? I see I can create a new StAXSource(omElementInstance.getXMLStreamReader()) and then use this in Transformer.transform(). Apparently the Transformer is for exclusive use with XSLT stylesheets... 
 
I would like to use FreeMarker because it's more simple and will achieve my goal more effectively but I don't see this being possible right now. More specifically I need an InputSource from the OMElement and haven't found a way of getting this through AXIOM api.
 
Any inputs is appreciated,
 
Thanks,
-Guillaume


____________________________________________________________________________________________________
This electronic mail (including any attachments) may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic email or its contents (including any attachments) by persons other than the intended recipient(s) is strictly prohibited. If you have received this message in error, please notify us immediately by reply email so that we may correct our internal records. Please then delete the original message (including any attachments) in its entirety. Thank you.

Re: Transform XML using Freemarker from an OMElement

Posted by Andreas Veithen <an...@gmail.com>.
If FreeMarker only supports XML documents from an InputSource object,
than you have no other choice than to serialize the OMElement and to
pass the result to FreeMarker as an InputSource referencing an
InputStream. If FreeMarker has support for other APIs (e.g. JAXP
Source objects), than there may be better solutions.

Andreas

On Tue, Apr 28, 2009 at 18:51, Jeudy, Guillaume <gj...@teksystems.com> wrote:
> Hi,
>
> I'm using Axis2 client stubs generated by wdsl2java tool. It works great but
> the WSDL file i'm using doesn't define everything so I get OMElements that
> are in free form on service methodĀ response objects. What I want to do is
> transform an OMElement treeĀ into another XML representation.
>
> Are there any recommended ways of doing this? I see I can create a new
> StAXSource(omElementInstance.getXMLStreamReader()) and then use this in
> Transformer.transform(). Apparently the Transformer is for exclusive use
> with XSLT stylesheets...
>
> I would like to use FreeMarker because it's more simple and will achieve my
> goal more effectively but I don't see this being possible right now. More
> specifically I need an InputSource from the OMElement and haven't found a
> way of getting this through AXIOM api.
>
> Any inputs is appreciated,
>
> Thanks,
> -Guillaume
>
> ________________________________
> This electronic mail (including any attachments) may contain information
> that is privileged, confidential, and/or otherwise protected from disclosure
> to anyone other than its intended recipient(s). Any dissemination or use of
> this electronic email or its contents (including any attachments) by persons
> other than the intended recipient(s) is strictly prohibited. If you have
> received this message in error, please notify us immediately by reply email
> so that we may correct our internal records. Please then delete the original
> message (including any attachments) in its entirety. Thank you.