Package nu.xom

Examples of nu.xom.Element.indexOf()


  public static void markupCharacters(Element e, boolean ieFix) {
    Nodes n = e.query("//text()");
    for(int i=0;i<n.size();i++) {
      String s = n.get(i).getValue();
      Element parent = (Element)n.get(i).getParent();
      int index = parent.indexOf(n.get(i));
      for(int j=0;j<s.length();j++) {
        Element c = new Element("char");
        String cStr = s.substring(j,j+1);
        if(ieFix && cStr.equals(" ")) cStr="\r";
        c.appendChild(cStr);
View Full Code Here


        System.out.println(neNodes.get(j).toXML());
        Matcher m = p.matcher(neTxt);
        if(m.matches()) {
          Element neElem = (Element)neNodes.get(j);
          Element parent = (Element)neElem.getParent();
          int index = parent.indexOf(neElem);
          neElem.removeChildren();
          neElem.appendChild(m.group(1));
          if(index == parent.getChildCount() - 1) {
            Text textNode = new Text(m.group(2));
            parent.appendChild(textNode);
View Full Code Here

    return snippets;
  }
 
  private static Element getElementInContext(Element elem) {
    Element context = (Element)elem.getParent();
    int index = context.indexOf(elem);
    if(context.getLocalName().equals("formula")) {
      index = context.getParent().indexOf(context);
      context = (Element)context.getParent();
    }
    StringBuffer previous = new StringBuffer();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.