On Wed, Sep 5, 2012 at 8:25 AM, Amila Suriarachchi <[email protected]> wrote: > hi all, > > I tested the $subject with the following code. Although we try to execute an > xpath for a small part it reads all the input stream. > > System.out.println("Running Axiom perf test..."); > > FileInputStreamWrapper fileInputStream = new > FileInputStreamWrapper("request_100.xml"); > > System.out.println("Number of bytes read ==> " + > fileInputStream.getNumberOfBytesRead()); > > XMLStreamReader xmlStreamReader = > StAXUtils.createXMLStreamReader(fileInputStream); > > System.out.println("Number of bytes read ==> " + > fileInputStream.getNumberOfBytesRead()); > > StAXOMBuilder stAXOMBuilder = new StAXOMBuilder(xmlStreamReader); > > OMElement omElement = stAXOMBuilder.getDocumentElement(); > > AXIOMXPath axiomxPath = new > AXIOMXPath("//ns1:echo/ns1:param0[1]/ns1:param1"); > axiomxPath.addNamespace("ns1","http://service.perf.test.com"); > > OMElement resultOMElement = (OMElement) > axiomxPath.selectSingleNode(omElement); > > System.out.println("Result OMElement ==> " + > resultOMElement.toString()); > > System.out.println("Number of bytes read ==> " + > fileInputStream.getNumberOfBytesRead()); > > And got the following. > > Number of bytes read ==> 0 > Number of bytes read ==> 32 > Result OMElement ==> <ns1:param1 > xmlns:ns1="http://service.perf.test.com">5</ns1:param1> > Number of bytes read ==> 102511 > > Is it possible to stop this and have the differed building with the xpath as > well?
No. Since we use Jaxen as XPath implementation and Jaxen has not been designed for this, it won't be possible. > thanks, > Amila. > > > -- > Amila Suriarachchi > WSO2 Inc. > blog: http://amilachinthaka.blogspot.com/ > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
