[Biojava-l] Problem parsing biojava xml file

benn benn at mpi-cbg.de
Wed Jun 4 18:16:50 UTC 2008


Hello,

         Sorry to pepper the board with questions!  I am working on 
BLAST parsing and have the standard output for BLAST working fine with 
JUnit tests.  So I am attempting to recreate this for files in XML 
format comming from blast (blastp), however I have the problem that I 
get a SAXExepttion that content is not allowed before prolog.  I thought 
I could have some invisible characters whihc is causing it to throw a 
wobbly but I cannto see any.  Has anyone else come across the problem.  
for completeness i have attached teh blast file and the code to parse is 
below:

<code>
   private List<SeqSimilaritySearchResult> parseBlast(String filename)
           throws IOException, SAXException, BioException {

       InputStream is = new FileInputStream(
               "src/test/resources/blast/standardoutput.blastp");

       BlastXMLParserFacade parser = new BlastXMLParserFacade();
       SeqSimilarityAdapter adapter = new SeqSimilarityAdapter();
       parser.setContentHandler(adapter);
       List<SeqSimilaritySearchResult> results = new 
ArrayList<SeqSimilaritySearchResult>();

       SearchContentHandler builder = new BlastLikeSearchBuilder(results,
               new DummySequenceDB("queries"),
               new DummySequenceDBInstallation());

       adapter.setSearchContentHandler(builder);

       parser.parse(new InputSource(is));
       return results;
   }
</code>

Cheers,

Neil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xmloutput.xml
Type: text/xml
Size: 48005 bytes
Desc: not available
URL: <http://lists.open-bio.org/pipermail/biojava-l/attachments/20080604/3455030a/attachment-0002.xml>


More information about the Biojava-l mailing list