Search Mailing List Archives
[bioontology-support] Parsing the BioPortal web service response
pgawade at openclinica.com
Fri Jan 20 06:23:52 PST 2012
I am planning to integrate my web application with BioPortal by using
REST web services API and would like to know more about how people parse
the web service response from BioPortal.
Some where I found the sample code to parse these xmls using DOM parser
which I am using right now and it works for simple cases but I think it
is not reliable because it is difficult to handle nested elements and
things like this with this way where you fetch the elements using
methods like getElementsByTagName(String ..).
Some sample code is here:
DocumentBuilderFactory docBuilderFactory =
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse(uri);
NodeList listClassBean1 = doc.getElementsByTagName("classBean");
I am not able to specify the level of elements in the hierarchy I want
to go up to as in the BioPortal web service response, "classBean" is at
multiple levels. I am thinking there might be better ways to do this may
be using APIs like castor or some how making use of schema files.
However BioPortal say they do not provide schema files. Could any body
please provide any suggests as to how they are doing it? Presently I am
planning to take a look at castor to see how I can use it with BioPortal
I will really appreciate the quick response from some body.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the bioontology-support