Hi Martin 1. I'm using BEA JDK on Windows system. This has nothing to do with JRE implementation
2. My concern is parsing multiple huge files by keeping a linked list of constructed OM elements may result in out-of-memory errors. Since my knowledge of AXIOM is limited, wonder if there is a way to get around this limitation? Thanks Chandru Ganesan -----Original Message----- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Thursday, December 20, 2007 2:49 PM To: axis-user@ws.apache.org Subject: Re: Stax Parsing in AXIOM Chandru does that answer the question of using in-memory of list vs using a persistence mechanism such as serialization? is this a requirement for your client? or maybe a future performance consideration? HP addresses this with a test harness which shl_load() the JRE under HP/UX as in javalib = shl_load( "/opt/java1.3/jre/lib/PA_RISC/classic/libjvm.sl", BIND_IMMEDIATE | BIND_VERBOSE,NULL); http://www.hp.com/products1/unix/java/infolibrary/prog_guide/classicJVM.html #loading as this is specific to HPUX with java1.3 JRE I encourage you to contact HP(UX) support for specifics for the JRE and version of HPUX you will be implementing.. M-- ----- Original Message ----- From: "Ganesan, Chandru" <[EMAIL PROTECTED]> To: <axis-user@ws.apache.org> Sent: Thursday, December 20, 2007 3:11 PM Subject: Stax Parsing in AXIOM Hi Dennis Thank You for the response. Much appreciated. Thanks Chandru Ganesan -----Original Message----- From: Dennis Sosnoski [mailto:[EMAIL PROTECTED] Sent: Thursday, December 20, 2007 2:05 PM To: axis-user@ws.apache.org Subject: Re: Looking for AXIOM experts Hi Chandru, I haven't stayed completely current on the latest changes, but AFAIK you're not going to get what you want by using AXIOM. By design, AXIOM will hold on to the constructed elements as you move through the list, so that you'll end up building the entire list in memory. To process this type of structure without building it in memory you need to either work directly with the parser or use a data binding implementation that allows you to process documents one piece at a time. You can do this with JiBX, for instance, by writing a custom unmarshaller for the <batch-request> element which just unmarshals and processes each <addRequest> separately, without holding on to the ones that have already been processed. I think you can use similar approaches with JAXB. - Dennis -- Dennis M. Sosnoski SOA and Web Services in Java Axis2 Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 Ganesan, Chandru wrote: > Hi > > Is there any AXIOM expert in this group who can answer this question? > > I sent this question to the appropriate group > "[EMAIL PROTECTED]", unfortunately this group is not quite active as I've not been getting any emails from this group for past few days. > > Thanks > Chandru Ganesan > -----Original Message----- > From: Ganesan, Chandru > Sent: Tuesday, December 18, 2007 5:13 PM > To: axis-user@ws.apache.org > Subject: StAX parsing of XML file using AXIOM API > > Hi > > I'm a newbie to Apache Axis2. I have few questions on AXIOM (StAX)API. Since I didn't get any answers to my original post to '[EMAIL PROTECTED]' mailing list, I'm posting to this group hoping for answers/guidance. > > I'd like to parse a huge file without building complete object model (linked list of OM elements) in memory i.e., I don't want the effect of going back in the inputstream and reading elements. > > I have following file structure: > > <Soap-Envelope> > <Soap-Header> > .... > </Soap-Header> > > <Soap-Body> > <batch-request> > <addRequest> > ...... > </addRequest> > > <addRequest> > <!-- thousands of addRequests here. I'd like to parse each addRequest one at a time without preserving OM elements of previous and subsequent elements > > <addRequest> > > </batch-request> > </Soap-Body> > </Soap-Envelope> > > I have following questions: > > 1. During my analysis, I found out that whenever I use an Iterator, as > in the code snippet below, to get a childElement using iterator.next(), AXIOM builds a link list of all child elements (OM Element) similar to DOM tree i.e., whole document is parsed and OM elements are created in memory. > > ..... > QName qName = new QName("http://schemas.xmlsoap.org/soap/envelope", > "Body", "soap"); Iterator itr = > soapEnvelope.getChildrenWithName(qName); > while(itr.hasNext()) { > OMElement element = (OMElement) itr.next(); } > > However, when I used StAXSOAPModelBuilder to extract SOAPEnvelope, SOAPElement, SOAPBody it is able to build without parsing the whole file. Following code does not build complete object model: > > StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(parser, "http://schemas.xmlsoap.org/soap/envelope/"); > QName soapHeaderQName = new QName("http://schemas.xmlsoap.org/soap/envelope/", "Header"); > SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement(); > SOAPHeader soapHeader = envelope.getHeader(); > > QName soapBodyQName = new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"); > SOAPBody soapBody = envelope.getBody(); > OMElement elem = soapBody.getFirstElement(); > > > 2. What is the best way to parse above SOAP file one addRequest at a > time without building OM elements for previous/subsequent addRequests? I cannot use SOAP builder as I have some XML files which are not SOAP based. > > Chandru Ganesan > HP Select Identity > 972.497.2403 (Work) > 3000 Waterview Pkwy > Richardson TX 75080 > > > --------------------------------------------------------------------- > 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] > > > --------------------------------------------------------------------- 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] --------------------------------------------------------------------- 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]