本文整理了Java中org.dom4j.Element.selectNodes()
方法的一些代码示例,展示了Element.selectNodes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.selectNodes()
方法的具体详情如下:
包路径:org.dom4j.Element
类名称:Element
方法名:selectNodes
暂无
代码示例来源:origin: spring-projects/spring-framework
@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");
}
代码示例来源:origin: igniterealtime/Openfire
List tabs = AdminConsole.getModel().selectNodes("//tab");
if (tabs.size() > 0) {
JspWriter out = pageContext.getOut();
代码示例来源:origin: igniterealtime/Openfire
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 )
代码示例来源:origin: igniterealtime/Openfire
for (Object o : element.selectNodes("//tab")) {
Element tab = (Element) o;
String id = tab.attributeValue("id");
代码示例来源:origin: hibernate/hibernate
public List selectNodes(String xpath) {
return element.selectNodes( xpath );
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
public List selectNodes(String xpath) {
return element.selectNodes( xpath );
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core
public List selectNodes(String xpath, String comparison) {
return element.selectNodes( xpath, comparison );
}
代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all
public List selectNodes(String xpath) {
return element.selectNodes( xpath );
}
代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all
public List selectNodes(String xpath, String comparison, boolean removeDups) {
return element.selectNodes( xpath, comparison, removeDups );
}
代码示例来源:origin: liukaixuan/guzz
/**
* Has any annotated businesses declared?
*/
public boolean hasAnnotatedBusiness(){
List bus = this.rootDoc.selectNodes("a-business") ;
return !bus.isEmpty() ;
}
代码示例来源:origin: org.opencms/opencms-core
/**
* @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);
}
代码示例来源:origin: org.opencms/opencms-solr
/**
* @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);
}
代码示例来源:origin: org.opencms/opencms-core
/**
* @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);
}
代码示例来源:origin: org.opencms/opencms-solr
/**
* @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);
}
代码示例来源:origin: liukaixuan/guzz
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") ;
}
代码示例来源:origin: liukaixuan/guzz
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") ;
}
代码示例来源:origin: liukaixuan/guzz
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 ;
}
代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all
public List selectNodes(String xpath, String comparison, boolean removeDups) {
return target().selectNodes( xpath, comparison, removeDups );
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
public List selectNodes(String xpath) {
return target().selectNodes( xpath );
}
代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all
public List selectNodes(String xpath, String comparison) {
return target().selectNodes( xpath, comparison );
}
内容来源于网络,如有侵权,请联系作者删除!