Package org.w3c.dom

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


                    if (existingPlugin.hasSameCoordinates(newPlugin)) {
                        // It's the same artifact, but might have a different
                        // version, exclusions, etc.
                        if (!inserted) {
                            // We haven't added the new one yet; do so now
                            pluginsElement.insertBefore(
                                    newPlugin.getElement(document),
                                    existingPluginElement);
                            inserted = true;
                            if (!newPlugin.getVersion().equals(
                                    existingPlugin.getVersion())) {
View Full Code Here


                    if (existingDependency.hasSameCoordinates(newDependency)) {
                        // It's the same artifact, but might have a different
                        // version, exclusions, etc.
                        if (!inserted) {
                            // We haven't added the new one yet; do so now
                            dependenciesElement.insertBefore(
                                    newDependency.getElement(document),
                                    existingDependencyElement);
                            inserted = true;
                            if (!newDependency.getVersion().equals(
                                    existingDependency.getVersion())) {
View Full Code Here

      DOMNodePointer p = (DOMNodePointer) it.next();
      Element title = (Element) p.getBaseValue();
      Element newTitle = document.createElementNS(NamespaceURI.DUBLIN_CORE, "dc:title");
      newTitle.appendChild(document.createTextNode(DOMUtil.getText(title)));
      Element info = (Element) title.getParentNode();
      info.insertBefore(newTitle, title);
      info.removeChild(title);
    }
    for (Iterator it = ctx.iteratePointers("//info/description"); it.hasNext();) {
      DOMNodePointer p = (DOMNodePointer) it.next();
      Element description = (Element) p.getBaseValue();
View Full Code Here

      DOMNodePointer p = (DOMNodePointer) it.next();
      Element description = (Element) p.getBaseValue();
      Element newDescription = document.createElementNS(NamespaceURI.DUBLIN_CORE, "dc:description");
      newDescription.appendChild(document.createTextNode(DOMUtil.getText(description)));
      Element info = (Element) description.getParentNode();
      info.insertBefore(newDescription, description);
      info.removeChild(description);
    }
    for (Iterator it = ctx.iteratePointers("//site/description|//feed/description"); it.hasNext(); ) {
      DOMNodePointer p = (DOMNodePointer) it.next();
      Element description = (Element) p.getBaseValue();
View Full Code Here

            // http://webfx.eae.net/dhtml/ieemu/htmlmodel.html
            // Con getNewValue() obtenemos el markup como string del nuevo nodo, esto no es est�ndar pero nos vale.
            String newValue = mutEvent.getNewValue();
            DocumentFragment newNodeFragment = itsNatDoc.getItsNatDocumentTemplateVersion().parseFragmentToDocFragment(newValue,itsNatDoc);
            Node newNode = newNodeFragment.getFirstChild();
            parent.insertBefore(newNode,refNode); // refNode puede ser null
            w3cMutEvent.setTargetNodeInserted((EventTarget)newNode); // De esta manera el usuario ver� el target de una forma est�ndar
        }
        else if (type.equals("DOMNodeRemoved"))
        {
            // El evento "DOMNodeRemoved" se procesa antes de que se haya quitado
View Full Code Here

        tableParent.appendChild(createRow(doc,2));

        TestUtil.checkError(table.getRowCount() == 3);

        tableParent.removeChild(table.getRowElementAt(1));
        tableParent.insertBefore(createRow(doc,1),table.getRowElementAt(1)); // Insertamos de nuevo

        TestUtil.checkError(table.getRowCount() == 3);

        // En las siguientes sentencias no se opera directamente con el DOM
        // pero simplemente para ver si funcionan en modo slave
View Full Code Here

      Element backupElement = dpf.newElementNode(document, "Backup");
      checkOutElement.appendChild(backupElement);
    }

        Element root = document.getDocumentElement();
    root.insertBefore(dpf.newTextNode(document, "\n"), root.getFirstChild());
        root.insertBefore(checkOutElement, root.getFirstChild());

        setDirty();

        // If this is a checkout, we write back the changed state
View Full Code Here

      checkOutElement.appendChild(backupElement);
    }

        Element root = document.getDocumentElement();
    root.insertBefore(dpf.newTextNode(document, "\n"), root.getFirstChild());
        root.insertBefore(checkOutElement, root.getFirstChild());

        setDirty();

        // If this is a checkout, we write back the changed state
        // to the file immediately because otherwise another
View Full Code Here

        checkOutElement.appendChild(identityElement);
        checkOutElement.appendChild(timeElement);

        Element root = document.getDocumentElement();
        root.insertBefore(dpf.newTextNode(document, "\n"), root.getFirstChild());
        root.insertBefore(checkOutElement, root.getFirstChild());
        root.insertBefore(dpf.newTextNode(document, "\n"), root.getFirstChild());

        setDirty();
View Full Code Here

        checkOutElement.appendChild(identityElement);
        checkOutElement.appendChild(timeElement);

        Element root = document.getDocumentElement();
        root.insertBefore(dpf.newTextNode(document, "\n"), root.getFirstChild());
        root.insertBefore(checkOutElement, root.getFirstChild());
        root.insertBefore(dpf.newTextNode(document, "\n"), root.getFirstChild());

        setDirty();

        // If this is a checkout, we write back the changed state
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.