NodeList iteration performance problem

By on Oct 21, 2012 in eng | 0 comments

I am having a performance problem with a module of my project. The code actually does something really easy. It just iterates over a NodeList and overwrites an attribute of each element. At first, I thought this slowness was related to the size of my XML document. I found out later that it has more to do with the underlying NodeList implementation.

XML Special Characters

By on Feb 23, 2011 in eng | 3 comments

A couple weeks ago, QA team of my project has reported that there was a defect in a module I have developed. The module is a part of our web services for distributing news data. The inbound execution flow is quite simple; the module accept SOAP request from client, transform it to a proprietary XML format of our backend server then send the transformed request to the backend news engine. The characteristic of the defect is that the users can not use string containing XML special characters as a search keyword e.g. they can not query news headlines containing “S&P500”. The news engine could not parse the requests causing exception on the backend server. It’s a pretty well known fact that there is a set of special characters that must be properly escaped using entity reference before an XML instance that contains these characters can be consumed by any standard XML parser. These...

JAXB Binder and XPath

By on May 14, 2010 in eng | 3 comments

I came across javax.xml.bind.Binder when I was reading SOA Using Java Web Services (excellent book). I had never used this class before so I set out to find how the class could be used. I found that the class hadn’t been mentioned as much as the classes like Marshaller or UnMarshaller but it was very useful Binder is usually used to perform partial binding; unmarshalling JAXB object from a part of XML DOM tree. JAXB specification states three use cases of the class. Two are related to partial binding and another one is about the capability of using XPath navigation. It is the last one that I am interested in the most because I actually have a module of my product that I can make use of this technique perfectly Below is the XML schema I have created just to simulate the functionality of the module <schema xmlns="http://www.w3.org/2001/XMLSchema"...