I am extracting big blocks from XML files by using XPath. My xml files are large, they are from PubMed. An example of my file type is:
ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/medline17n0001.xml.gz
So, by using
Node result = (Node)xPath.evaluate("PubmedArticleSet/PubmedArticle[MedlineCitation/PMID = "+PMIDtoSearch+"]", doc, XPathConstants.NODE);
I get the article with PMIDtoSearch, so its perfect. But it takes much time. I have to do it around 800.000 times, so with this solution it would take more than two months. Some blocks has more than 400 lines and each xml file has more than 4 millions of lines.
I also have tried a solution like this getElementsByTagName function but it takes almost the same time.
Do you know how improve the solution?
Thanks.