@SuppressWarnings("rawtypes") private void assertHtmlOutput(String output) throws Exception { SAXReader reader = new SAXReader(); Document document = reader.read(new StringReader(output)); List nodes = document.getRootElement().selectNodes("/html/body/table/tr"); Element tr1 = (Element) nodes.get(0); assertRowElement(tr1, "1", "Whatsit", "12.99"); Element tr2 = (Element) nodes.get(1); assertRowElement(tr2, "2", "Thingy", "13.99"); Element tr3 = (Element) nodes.get(2); assertRowElement(tr3, "3", "Gizmo", "14.99"); Element tr4 = (Element) nodes.get(3); assertRowElement(tr4, "4", "Cranktoggle", "11.99"); }
List tabs = AdminConsole.getModel().selectNodes("//tab"); if (tabs.size() > 0) { JspWriter out = pageContext.getOut();
final List urls = adminElement.selectNodes( "//@url" ); for ( final Object url : urls ) for ( final String elementName : elementNames ) final List values = adminElement.selectNodes( "//" + elementName ); for ( final Object value : values )
for (Object o : element.selectNodes("//tab")) { Element tab = (Element) o; String id = tab.attributeValue("id");
public List selectNodes(String xpath) { return element.selectNodes( xpath ); }
public List selectNodes(String xpath) { return element.selectNodes( xpath ); }
public List selectNodes(String xpath, String comparison) { return element.selectNodes( xpath, comparison ); }
public List selectNodes(String xpath) { return element.selectNodes( xpath ); }
public List selectNodes(String xpath, String comparison, boolean removeDups) { return element.selectNodes( xpath, comparison, removeDups ); }
/** * Has any annotated businesses declared? */ public boolean hasAnnotatedBusiness(){ List bus = this.rootDoc.selectNodes("a-business") ; return !bus.isEmpty() ; }
/** * @see org.opencms.importexport.I_CmsImportExportHandler#matches(org.dom4j.Document) */ public boolean matches(Document manifest) { Element rootElement = manifest.getRootElement(); boolean hasModuleNode = (rootElement.selectNodes( "./" + CmsModuleXmlHandler.N_MODULE + "/" + CmsModuleXmlHandler.N_NAME).size() > 0); boolean hasInfoNode = (rootElement.selectNodes("./" + CmsImportExportManager.N_INFO).size() == 1); return (!hasModuleNode && hasInfoNode); }
/** * @see org.opencms.importexport.I_CmsImportExportHandler#matches(org.dom4j.Document) */ public boolean matches(Document manifest) { Element rootElement = manifest.getRootElement(); boolean hasModuleNode = (rootElement.selectNodes( "./" + CmsModuleXmlHandler.N_MODULE + "/" + CmsModuleXmlHandler.N_NAME).size() > 0); boolean hasInfoNode = (rootElement.selectNodes("./" + CmsImportExportManager.N_INFO).size() == 1); return (!hasModuleNode && hasInfoNode); }
/** * @see org.opencms.importexport.I_CmsImportExportHandler#matches(org.dom4j.Document) */ public boolean matches(Document manifest) { Element rootElement = manifest.getRootElement(); return (rootElement.selectNodes("./module/name").size() > 0); }
/** * @see org.opencms.importexport.I_CmsImportExportHandler#matches(org.dom4j.Document) */ public boolean matches(Document manifest) { Element rootElement = manifest.getRootElement(); return (rootElement.selectNodes("./module/name").size() > 0); }
public static String getDomainClassBusinessName(Element root) throws DocumentException, IOException, SAXException{ List bus = root.selectNodes("//class") ; if(bus == null) return null ; if(bus.size() != 1){ throw new DocumentException("too many class name") ; } Element e = (Element) bus.get(0) ; return e.attributeValue("businessName") ; }
public static String getDomainClassDbGroup(Element root) throws DocumentException, IOException, SAXException{ List bus = root.selectNodes("//class") ; if(bus == null) return null ; if(bus.size() != 1){ throw new DocumentException("too many class name") ; } Element e = (Element) bus.get(0) ; return e.attributeValue("dbGroup") ; }
public List listGlobalORMs() throws IOException, ClassNotFoundException{ List ls = this.rootDoc.selectNodes("orm") ; LinkedList list = new LinkedList() ; if(ls.isEmpty()) return list ; for(int i = 0 ; i < ls.size() ; i++){ Element e = (Element) ls.get(i) ; ResultMapBasedObjectMapping map = loadORM(gf, null, e) ; list.addLast(map) ; } return list ; }
public List selectNodes(String xpath, String comparison, boolean removeDups) { return target().selectNodes( xpath, comparison, removeDups ); }
public List selectNodes(String xpath) { return target().selectNodes( xpath ); }
public List selectNodes(String xpath, String comparison) { return target().selectNodes( xpath, comparison ); }