xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Remy" <dr...@bea.com>
Subject RE: Avoiding unnecessary copying
Date Thu, 17 Jun 2004 23:53:48 GMT

> -----Original Message-----
> From: nn [mailto:nnakae@comcast.net]
> Sent: Thursday, June 17, 2004 3:20 PM
> To: xmlbeans-user@xml.apache.org
> Subject: Re: Avoiding unnecessary copying
> 
> Hi Mark,
> 
> I had similar problem to adapt XMLBeans for SAXON.
> SAXON depends on specific API, so it was ncessary to create
NodeWrapper
> class from XmlObject.

Is it possible to see the code that you wrote to work with SAXON?  I
don't know perhaps we could suggest something if we see it ...

> This worked, but from performance point of view, this was not
> satisfactory.
> XmlObject(or XMLBeans generated classes) should directly implement
these
> interfaces.
> 
> in the comming new release it will support adding interface for
generated
> class.

actually this feature will also be in the imminent xmlbeans 1.03
release.

> So it may be possible to implement DOM api using this feature.
> 
> But DOM API is so standard, it would be useful for XMLBeans to support
> this
> feature directly.

dom level 2 is implemented natively in v2.  it becomes a peer api to
xmlcursor (and you will be able to switch at will from dom, xmlcursor,
and xmlobject).  this is under the newstore2 in v2.  eric has
implemented the dom code, and is in the process of moving over the
existing apis (xmlcursor, etc.) over to the newstore.  this is a big
task so i assume it will be a couple of months before the newstore is
fully functional in v2.  

>  (maybe by choosing option for code generation time).
> 
> For the DOM API implementation, there are a few issues since XMLBeans
does
> not follow DOM API structure.
> I sent a reply and explained how to implement getChildren etc from
> XmlObject.
> You can see it.

just curious did you see the api that was added by cezar to
selectChildren, selectAtributes, etc.?  there is a mini spec for it
here:

http://wiki.apache.org/xmlbeans/SelectChildrenAndAttributesFeature 

> 
> Another approach is to use AOP approach (e.g, AspectWerkz), then even
if
> XMLBeans does not have the new feature,  XmlObject(or XMLBean
generated
> classes) can be mixen and implement given interface magically.
> 
> nn
> 
> 
> ----- Original Message -----
> From: "Mark Lewis" <mark.lewis@mir3.com>
> To: <xmlbeans-user@xml.apache.org>
> Sent: Thursday, June 17, 2004 10:47 AM
> Subject: Avoiding unnecessary copying
> 
> 
> > I have a working program using xmlbeans 1.0.2 to invoke some web
> > services, but I'm trying to figure out if I can make it more
efficient.
> > I was hoping someone out there can point me in the right direction.
> >
> > I'm using SAAJ to invoke web services (document-style), and I need
to
> > pass it a DOM object to send.  I'm currently using
> > XmlObject.newDomNode() to generate the DOM from my bean, but that
makes
> > a complete copy of my XML as a DOM node prior to sending.
> >
> > Is anybody familiar with a simple way of invoking a web-service that
> > doesn't involve this extra copy?
> >
> > Here's my current code:
> >
> >             // Convert the XmlBeans object to a DOM-node
> >             Document document = (Document)xmlData.newDomNode();
> >
> >             // Create the SOAPMessage and SOAPConnection to send
> >             SOAPMessage message;
> >             SOAPConnection connection;
> >             synchronized(this) {
> >                 message = messageFactory.createMessage();
> >                 connection = connectionFactory.createConnection();
> >             }
> >
> >             // Prepare the SOAPMessage
> >             message.getSOAPHeader().detachNode();
> >             SOAPBody body = message.getSOAPBody();
> >             body.addDocument( document );
> >             message.saveChanges();
> >
> >             // Send the message
> >             SOAPMessage response = connection.call(message,
endpoint);
> >
> >
> > Thanks for any pointers,
> > Mark Lewis
> >
> >
> > -
---------------------------------------------------------------------
> > To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
> > Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
> >
> 
> 
> -
---------------------------------------------------------------------
> To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
> Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Mime
View raw message