Package nu.xom

Examples of nu.xom.ParentNode.removeChild()


          continue; // optimization: no need to remove and then readd same element
        }

        if (parent.getChildCount()-1 < 0) throwTamperedWithParent();       
        if (parent instanceof Element) { // can't remove root element
          parent.removeChild(parent.getChildCount()-1);
        }
        appendNodes(parent, nodes, i);
      } catch (RuntimeException e) {
        onException(i, e);
      }
View Full Code Here


            ParentNode parent = element.getParent();
            int position = 0;
            for (; position < parent.getChildCount(); position++) {
                if (parent.getChild(position) == element) break;
            }
            parent.removeChild(position);
            while (element.getChildCount() > 0) {
                Node child = element.getChild(0);
                element.removeChild(0);
                parent.insertChild(child, position);
                position++;
View Full Code Here

                        }
                        else {
                            parent.insertChild(replacement, parent.indexOf(element));
                        }  
                    }                   
                    parent.removeChild(element);
                }
                else {
                   throw new BadParseAttributeException(
                     "Bad value for parse attribute: " + parse,
                     element.getDocument().getBaseURI());  
View Full Code Here

                        }
                        else {
                            parent.insertChild(replacement, parent.indexOf(element));
                        }  
                    }                   
                    parent.removeChild(element);
                }
                else {
                   throw new BadParseAttributeException(
                     "Bad value for parse attribute: " + parse,
                     element.getDocument().getBaseURI());  
View Full Code Here

    for (int j = 0; j < toInsert.size(); j++) {
      Element child = toInsert.get(j);
      child.detach();
      parent.insertChild(child, ++pos);
    }
    parent.removeChild(toReplace);           
  }
 
  public static void replace(Node replaced, List<Node> replacements) {
    ParentNode parent = replaced.getParent();
    int pos = parent.indexOf(replaced);
View Full Code Here

  }
 
  public static void replace(Node replaced, List<Node> replacements) {
    ParentNode parent = replaced.getParent();
    int pos = parent.indexOf(replaced);
    parent.removeChild(replaced);
    if(pos==0) pos = -1;
    for (Node node : replacements) {     
      node.detach();   
      parent.insertChild(node, ++pos);     
   
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.