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 "Yarmamedov, Vasyl" <va...@sigma-systems.com> on 2007/05/12 21:05:22 UTC

[Axis2] Axiom, What is the best way to add existing DOM (created by xerces) element to OMElement?

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

 

 


Re: [Axis2] Axiom, What is the best way to add existing DOM (created by xerces) element to OMElement?

Posted by Davanum Srinivas <da...@gmail.com>.
Yes, it's packaging. we may have to refactor stuff. It may be better
to move XMLStreamReaderFromDOM directly into axiom in the long run.

-- dims

On 5/14/07, Yarmamedov, Vasyl <va...@sigma-systems.com> wrote:
> Than obvious question why XMLUtils.toOM is not implemented through
> XMLStreamReaderFromDOM? (possible answer is packaging)
> Or is it uncommon operation for axis developers to convert existing DOM
> to
> Axiom?
>
> Thank You
>
>
> -----Original Message-----
> From: Davanum Srinivas [mailto:davanum@gmail.com]
> Sent: Sunday, May 13, 2007 11:02 AM
> 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?
>
> yes , XMLStreamReaderFromDOM is much better.
>
> thx,
> dims
>
> On 5/13/07, Yarmamedov, Vasyl <va...@sigma-systems.com>
> wrote:
> > 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 <va...@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
> >
> >
>
>
> --
> 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
>
>


-- 
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


RE: [Axis2] Axiom, What is the best way to add existing DOM (created by xerces) element to OMElement?

Posted by "Yarmamedov, Vasyl" <va...@sigma-systems.com>.
Than obvious question why XMLUtils.toOM is not implemented through
XMLStreamReaderFromDOM? (possible answer is packaging)
Or is it uncommon operation for axis developers to convert existing DOM
to 
Axiom?

Thank You


-----Original Message-----
From: Davanum Srinivas [mailto:davanum@gmail.com] 
Sent: Sunday, May 13, 2007 11:02 AM
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?

yes , XMLStreamReaderFromDOM is much better.

thx,
dims

On 5/13/07, Yarmamedov, Vasyl <va...@sigma-systems.com>
wrote:
> 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 <va...@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
>
>


-- 
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


Re: [Axis2] Axiom, What is the best way to add existing DOM (created by xerces) element to OMElement?

Posted by Davanum Srinivas <da...@gmail.com>.
yes , XMLStreamReaderFromDOM is much better.

thx,
dims

On 5/13/07, Yarmamedov, Vasyl <va...@sigma-systems.com> wrote:
> 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 <va...@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
>
>


-- 
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


RE: [Axis2] Axiom, What is the best way to add existing DOM (created by xerces) element to OMElement?

Posted by "Yarmamedov, Vasyl" <va...@sigma-systems.com>.
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 <va...@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


Re: [Axis2] Axiom, What is the best way to add existing DOM (created by xerces) element to OMElement?

Posted by Davanum Srinivas <da...@gmail.com>.
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 <va...@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