axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yarmamedov, Vasyl" <vasyl.yarmame...@sigma-systems.com>
Subject RE: [Axis2] Axiom, What is the best way to add existing DOM (created by xerces) element to OMElement?
Date Sun, 13 May 2007 13:32:34 GMT
Here are two examples - one with XMLUtils and another one using
org.apache.axis2.jaxws.message.util.impl.XMLStreamReaderFromDOM:

public void addUsingXmlUtil(OMElement oe,Element dom) throws Exception {
        OMElement convertedOE = XMLUtils.toOM(dom);
        oe.addChild(convertedOE);
        oe.serialize(new
org.apache.commons.io.output.NullOutputStream());
}
    
public void addUsingDomReader(OMElement oe,Element dom) throws Exception
{
        XMLStreamReaderFromDOM domStreamReader = 
			new XMLStreamReaderFromDOM(phones);
        StAXOMBuilder domBuilder = new StAXOMBuilder(domStreamReader);
        OMElement convertedOE = domBuilder.getDocumentElement();
        oe.addChild(convertedOE);
        oe.serialize(new
org.apache.commons.io.output.NullOutputStream());
    }

Usage of DOM reader from axis-jaxws delivers better results comparing to
XMLUtils.

Any comments, known caveats that would prevent usage of
XMLStreamReaderFromDOM? (one I found - DOM model must be namespace
aware)

Thank You

-----Original Message-----
From: Davanum Srinivas [mailto:davanum@gmail.com] 
Sent: Saturday, May 12, 2007 9:25 PM
To: axis-user@ws.apache.org
Subject: Re: [Axis2] Axiom, What is the best way to add existing DOM
(created by xerces) element to OMElement?

See org.apache.axis2.util.XMLUtils.toOM method

http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel
/src/org/apache/axis2/util/XMLUtils.java?view=annotate

-- dims

On 5/12/07, Yarmamedov, Vasyl <vasyl.yarmamedov@sigma-systems.com>
wrote:
>
>
>
>
> Hi,
>
>
>
> I have a DOM element object that has to be part of WS response. What
is the
> best way to add it (DOM element) to response OMElement?
>
>
>
> I posted same question to axiom-dev, but looks like this group is more
> active.
>
>
>
> Thank You
>
>
>
>


-- 
Davanum Srinivas :: http://davanum.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message