On Mon, Apr 8, 2013 at 2:36 AM, Andreas Veithen <[email protected]>wrote:
> On Sun, Apr 7, 2013 at 11:49 AM, Amila Suriarachchi > <[email protected]> wrote: > > > > > > > > On Mon, Apr 1, 2013 at 12:14 PM, Andreas Veithen < > [email protected]> > > wrote: > >> > >> On Sun, Mar 24, 2013 at 9:19 AM, Isuru Ranawaka <[email protected]> > >> wrote: > >> > 1. ) Streaming Xpath Parser is developed for a ESB which get AXIOM > >> > Object > >> > and traverse through it and get results.here the main concern is to > >> > improve > >> > the performance of xpath parsing by specifying specific rules relevant > >> > to > >> > the domain. (e.g if there is expression such as “/data/book” it only > >> > give > >> > the first child element under the data element ) what i suggest is > >> > creating > >> > a XpathEngine which does not consume any external object model and it > >> > will > >> > operate on top of the XML Stream that means traverse xmlstream and > >> > evaluate > >> > xpath. > >> > >> Can you explain how this would work for an expression like > >> /data/book[isbn='1-84356-028-3']? > > > > > > Let me give an expiation for this. > > > > For that scenario it won't work. There is no way to verify whether there > is > > an element matching unless it reads the whole xml stream. > > > > But scenarios like /data/book[1] it will work. the assumption here is > that > > ESBs like synapse it may not required to build the whole envelop to > process > > the xpaths always. For such cases it would give a performance advantage. > > According to Isuru the "XPath" implementation would operate on an > XMLStreamReader. That means that after evaluating the expression, > everything before /data/book[1] will have been discarded. How would > Synapse manage the case where a subsequent mediator in the same > mediation attempts to access that part of the message? > I think there are two ways to get the underline xml stream reader from the Axiom Object. We can get the xml stream reader so that it builds the Axiom Element. And also there are some use cases where Synapse needs only to evaluate an Xpath and route message to back end. eg content based routing. In such cases we don't need to build the message. We can buffer the message and route the message directly to back end endpoint. Let me explain the idea of this process taking your question into account. Lets say a given xml has 10 book objects. Now the isbn number you mentioned can possibly be at positions 1-10. If it is in first position then this Xpath evaluator only read the first element. If it is ten then I has to read all. So it only read the required amount from the xml message. Worst case it can be whole envelop. thanks, Amila. > > > thanks, > > Amila. > >> > >> > >> Andreas > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [email protected] > >> For additional commands, e-mail: [email protected] > >> > > > > > > > > -- > > Amila Suriarachchi > > WSO2 Inc. > > blog: http://amilachinthaka.blogspot.com/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/
