Package org.w3c.dom

Examples of org.w3c.dom.Node.replaceChild()


        _contextDocument.removeChild(_contextDocument.getDocumentElement());
        _contextDocument.appendChild(decryptedFragment);
    }
    else {
        sourceParent.replaceChild(decryptedFragment, element);

    }

        return (_contextDocument);
    }
View Full Code Here


            copy.insertBefore(nextChild, null);
        }

        Node parent = element.getParentNode();
        if (parent != null) {
            parent.replaceChild(copy, element);
        } // XXX else throw an exception?

        return copy;
    }
View Full Code Here

    NodeList list = data.getChildNodes();
    if (list.getLength() == 0) {
      data.appendChild(domDocument.importNode(node, true));
    }
    else {
      data.replaceChild(domDocument.importNode(node, true), data.getFirstChild());
    }
        extractNodes();
    setChanged(true);
    }
}
View Full Code Here

    encryptData(_contextDocument, element, false);

        Element encryptedElement = _factory.toElement(_ed);

        Node sourceParent = element.getParentNode();
        sourceParent.replaceChild(encryptedElement, element);

        return (_contextDocument);
    }

    /**
 
View Full Code Here

        _contextDocument.removeChild(_contextDocument.getDocumentElement());
        _contextDocument.appendChild(decryptedFragment);
    }
    else {
        sourceParent.replaceChild(decryptedFragment, element);

    }

        return (_contextDocument);
    }
View Full Code Here

       
        if (decryptedNode != null
            && decryptedNode.getParentNode().getLocalName().equals(WSConstants.ENCRYPED_ASSERTION_LN)
            && decryptedNode.getParentNode().getNamespaceURI().equals(WSConstants.SAML2_NS)) {
            Node soapHeader = decryptedNode.getParentNode().getParentNode();
            soapHeader.replaceChild(decryptedNode, decryptedNode.getParentNode());
        }
       
        WSSecurityEngineResult result =
                new WSSecurityEngineResult(WSConstants.ENCR, Collections.singletonList(dataRef));
        result.put(WSSecurityEngineResult.TAG_ID, elem.getAttributeNS(null, "Id"));
View Full Code Here

            || parent.getLocalName().equals(WSConstants.ENCRYPED_ASSERTION_LN)
            && parent.getNamespaceURI().equals(WSConstants.SAML2_NS)) {
               
            Node decryptedHeader = parent.getFirstChild();
            Node soapHeader = parent.getParentNode();
            soapHeader.replaceChild(decryptedHeader, parent);

            dataRef.setProtectedElement((Element)decryptedHeader);
            dataRef.setXpath(getXPath(decryptedHeader));
        } else if (content) {
            dataRef.setProtectedElement(encData);
View Full Code Here

              if (mediaAttribute != null)
                newNode.setAttribute("media", mediaAttribute.getTextContent());

              newNode.setTextContent(fileString);

              parent.replaceChild(newNode, node);
            }
          }
        }
      }
    }
View Full Code Here

                if (parent != null)
                {
                  final Element newImgNode = doc.createElement("img");
                  newImgNode.setAttribute("src", "data:image/" + extension + ";base64," + srcFileEncodedString);

                  parent.replaceChild(newImgNode, node);
                }
              }
            }
          }
        }
View Full Code Here

        // Copy all Child Elements
        for (Node node = elem.getFirstChild(); node != null; node = node.getNextSibling())
            newElem.appendChild(node.cloneNode(true));
        // insert
        Node parent = elem.getParentNode();
        parent.replaceChild(newElem, elem);
        return true;
    }

}
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.