@Test public void testParse() { try { testStream = PubMedXMLParserTest.class.getResourceAsStream( "/data/pubmed-test.xml" ); Collection<BibliographicReference> brl = testParser.parse( testStream ); BibliographicReference br = brl.iterator().next(); assertEquals( "Lee, Homin K; Hsu, Amy K; Sajdak, Jon; Qin, Jie; Pavlidis, Paul", br.getAuthorList() ); assertNotNull( br.getAbstractText() ); assertEquals( "Genome Res", br.getPublication() ); assertEquals( "15173114", br.getPubAccession().getAccession() ); assertEquals( "Coexpression analysis of human genes across many microarray data sets.", br.getTitle() ); assertNotNull( br.getVolume() ); assertNotNull( br.getPages() ); SimpleDateFormat f = new SimpleDateFormat( "mm/HH/MM/dd/yyyy" ); assertEquals( "00/00/06/01/2004", f.format( br.getPublicationDate() ) ); } catch ( RuntimeException e ) { this.logOrThrowException( e ); } }
public Collection<BibliographicReference> parse( InputStream is ) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setIgnoringComments( true ); factory.setValidating( false ); builder = factory.newDocumentBuilder(); Document document = builder.parse( is ); PubMedXMLParser.log.debug( "done parsing" ); return this.extractBibRefs( document ); } catch ( IOException | SAXException | ParserConfigurationException e ) { throw new RuntimeException( e ); } }
PubMedXMLParser { public Collection<BibliographicReference> parse( InputStream is ) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setIgnoringComments( true ); factory.setValidating( false ); builder = factory.newDocumentBuilder(); Document document = builder.parse( is ); PubMedXMLParser.log.debug( "done parsing" ); return this.extractBibRefs( document ); } catch ( IOException | SAXException | ParserConfigurationException e ) { throw new RuntimeException( e ); } } }
PubMedXMLParser { public Collection<BibliographicReference> parse( InputStream is ) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setIgnoringComments( true ); factory.setValidating( false ); builder = factory.newDocumentBuilder(); Document document = builder.parse( is ); PubMedXMLParser.log.debug( "done parsing" ); return this.extractBibRefs( document ); } catch ( IOException | SAXException | ParserConfigurationException e ) { throw new RuntimeException( e ); } }  }
PubMedXMLParser { public Collection<BibliographicReference> parse( InputStream is ) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setIgnoringComments( true ); factory.setValidating( false ); builder = factory.newDocumentBuilder(); Document document = builder.parse( is ); PubMedXMLParser.log.debug( "done parsing" ); return this.extractBibRefs( document ); } catch ( IOException | SAXException | ParserConfigurationException e ) { throw new RuntimeException( e ); } }  void extractBookPublicationYear( BibliographicReference bibRef, Node item ); void extractPublisher( BibliographicReference bibRef, Node item ); Collection<BibliographicReference> parse( InputStream is ); }
PubMedXMLParser { public Collection<BibliographicReference> parse( InputStream is ) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setIgnoringComments( true ); factory.setValidating( false ); builder = factory.newDocumentBuilder(); Document document = builder.parse( is ); PubMedXMLParser.log.debug( "done parsing" ); return this.extractBibRefs( document ); } catch ( IOException | SAXException | ParserConfigurationException e ) { throw new RuntimeException( e ); } }  void extractBookPublicationYear( BibliographicReference bibRef, Node item ); void extractPublisher( BibliographicReference bibRef, Node item ); Collection<BibliographicReference> parse( InputStream is );  }