Package org.w3c.dom

Examples of org.w3c.dom.Element.insertBefore()


                descE = doc.createElementNS(SVGConstants.SVG_NAMESPACE_URI,
                                           SVGConstants.SVG_DESC_TAG);
                descE.appendChild(doc.createTextNode(message));

                infoE.insertBefore(descE, infoE.getFirstChild());
                infoE.insertBefore(titleE, descE);
            } catch (Exception ex) {
                throw new BridgeException
                    (bridgeContext, e, ex, ErrorConstants.ERR_URI_IMAGE_BROKEN,
                     new Object[] {url, message });
            }
View Full Code Here


        Element element = (Element)anl.item(i);
        if(element.getAttribute("name").equalsIgnoreCase(this.attributeName) && previousElement != null)
        {
          Element parent = (Element)element.getParentNode();
          parent.removeChild(element);
          parent.insertBefore(element, previousElement);
        }
        previousElement = element;
      }

      saveUpdatedDefinition(document);
View Full Code Here

          // find head
          org.w3c.dom.Node head = nodeVisitor.head;
          // Insert empty if not found
          if (null == head) {
            head = document.createElement("head");
            documentElement.insertBefore(head, documentElement
                .getFirstChild());
          }
          org.w3c.dom.Node child = head.getFirstChild();
          while (child != null) {
            if (child instanceof Element) {
View Full Code Here

      Element svgNode = document.getDocumentElement();

      if (svgNode.hasChildNodes())
      {
        svgNode.insertBefore(defs, svgNode.getFirstChild());
      }
      else
      {
        svgNode.appendChild(defs);
      }
View Full Code Here

                    Element destElm = null;

                    if (header.length == 0) {
                        Element docElm = ((Document) dest.getDomNode()).getDocumentElement();

                        destElm = (Element) docElm.insertBefore(
                                docElm.getOwnerDocument().createElementNS(soapVersion.getEnvelopeNamespace(),
                                        docElm.getPrefix() + ":Header"),
                                XmlUtils.getFirstChildElementNS(docElm, soapVersion.getBodyQName()));
                    } else {
                        destElm = (Element) header[0].getDomNode();
View Full Code Here

      assertEquals(test3, children1.item(2));
      assertEquals(test4, children1.item(3));
      assertEquals(test5, children1.item(4));

      // test replace child
      div.insertBefore(test6, test3);

      // examine children
      NodeList children2 = div.getChildNodes();
      assertEquals(test1, children2.item(0));
      assertEquals(test2, children2.item(1));
View Full Code Here

      fragment.appendChild(test7);
      fragment.appendChild(test8);
      fragment.appendChild(test9);

      // test replace child
      div.insertBefore(fragment, test3);

      // examine children
      NodeList children2 = div.getChildNodes();

      assertEquals(test1, children2.item(0));
View Full Code Here

    Element field = selected.getOwnerDocument().createElement(elementName);
    Element mappingNode = null
   
    if ("field".equals(selected.getNodeName()) || "field-exclude".equals(selected.getNodeName())) {
      mappingNode = (Element)selected.getParentNode();
      mappingNode.insertBefore(field, selected);
    } else {
      mappingNode = selected;
      mappingNode.appendChild(field);     
    }
   
View Full Code Here

                            r._text.fetch(
                                c.getCpForPos( r, 1 ), c.getCchValue() );
                    }

                    if (text != null)
                        e.insertBefore( _doc.createTextNode( text ), null );
                }
                else
                {
                    _currentNode = e;
                }
View Full Code Here

              refChild = null;
            } else {
              refChild = children.item(position + 1);
            }
            for (int i = 0; i < childNodes.size(); i++) {
              clonedElmt.insertBefore((Node) childNodes.get(i), refChild);
            }
            return clonedElmt;
      }
    }
   
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.