@Test public void ApplicantOrg() throws DocumentException { String xml = "<us-patent-grant><us-bibliographic-data-grant><us-parties><us-applicants>\r\n" + "<us-applicant app-type=\"applicant\" designation=\"us-only\" sequence=\"001\">\r\n" + "<addressbook>\r\n" + "<orgname>JACQUET DOE DISTRIBUTION</orgname>\r\n" + "<address>\r\n" + "<city>Paris</city>\r\n" + "<country>FR</country>\r\n" + "</address>\r\n" + "</addressbook>\r\n" + "<residence>\r\n" + "<country>FR</country>\r\n" + "</residence>\r\n" + "</us-applicant>\r\n" + "</us-applicants></us-parties></us-bibliographic-data-grant></us-patent-grant>"; Document doc = DocumentHelper.parseText(xml); List<Applicant> appls = new ApplicantNode(doc).read(); assertEquals("JACQUET DOE DISTRIBUTION", ((NameOrg) appls.get(0).getName()).getName()); assertEquals("Jacquet Doe Distribution", ((NameOrg) appls.get(0).getName()).getNameNormalizeCase()); assertEquals(CountryCode.FR, appls.get(0).getAddress().getCountry()); assertEquals("Paris", appls.get(0).getAddress().getCity()); }
@Override public List<Applicant> read() { List<Applicant> applicantList = new ArrayList<Applicant>(); List<Node> applNodes = document.selectNodes(FRAGMENT_PATH); applicantList.addAll(readApplicants(applNodes)); return applicantList; }
ApplicantNode extends DOMFragmentReader<List<Applicant>> { @Override public List<Applicant> read() { List<Applicant> applicantList = new ArrayList<Applicant>(); List<Node> applNodes = document.selectNodes(FRAGMENT_PATH); applicantList.addAll(readApplicants(applNodes)); return applicantList; } }
ApplicantNode extends DOMFragmentReader<List<Applicant>> { @Override public List<Applicant> read() { List<Applicant> applicantList = new ArrayList<Applicant>(); List<Node> applNodes = document.selectNodes(FRAGMENT_PATH); applicantList.addAll(readApplicants(applNodes)); return applicantList; } ApplicantNode(Document document); }
ApplicantNode extends DOMFragmentReader<List<Applicant>> { @Override public List<Applicant> read() { List<Applicant> applicantList = new ArrayList<Applicant>(); List<Node> applNodes = document.selectNodes(FRAGMENT_PATH); applicantList.addAll(readApplicants(applNodes)); return applicantList; } ApplicantNode(Document document); @Override List<Applicant> read(); }
ApplicantNode extends DOMFragmentReader<List<Applicant>> { @Override public List<Applicant> read() { List<Applicant> applicantList = new ArrayList<Applicant>(); List<Node> applNodes = document.selectNodes(FRAGMENT_PATH); applicantList.addAll(readApplicants(applNodes)); return applicantList; } ApplicantNode(Document document); @Override List<Applicant> read();  }