Package au.id.jericho.lib.html

Examples of au.id.jericho.lib.html.Element


  }
 
  public String getPath() {
    ArrayList<String> store = new ArrayList<String>() ;
   
    Element current = element ;
    Element parent = element.getParentElement() ;
    while(parent != null){
      List<Element> childs = parent.getChildElements() ;
      for (int i = 0, findex=0; i < childs.size(); i++) {
        if (childs.get(i).getName().equals(current.getName()) && current == childs.get(i)){
          store.add(current.getName() + "[" + findex + "]") ;
          break ;
        } else if (childs.get(i).getName().equals(current.getName())){
          findex++ ;
        }
      }
     
      current = parent ;
      parent = parent.getParentElement() ;
    }

    Collections.reverse(store) ;
    return "/" + StringUtil.join((String[])store.toArray(new String[0]), "/") ;
  }
View Full Code Here

TOP

Related Classes of au.id.jericho.lib.html.Element

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.