orig.getDoctype().getSystemId())); doc.removeChild(doc.getDocumentElement()); } else { doc = builder.newDocument();
ret.removeChild(root);
/** * @inheritDoc */ public Node removeChild(Node oldChild) throws DOMException { return dom.removeChild(oldChild); }
public Node removeChild(Node oldChild) throws DOMException { return document.removeChild(oldChild); }
@Override public Node removeChild(Node oldChild) throws DOMException { return original_.removeChild(oldChild); }
@Override public Node removeChild(Node oldChild) throws DOMException { return original_.removeChild(oldChild); }
/** * Remove the content of an existing document. * @param doc the document to clear * @return the empty */ public static Document emptyDocument(Document doc) { Element rootNode = doc.getDocumentElement(); if(rootNode!=null) { doc.removeChild(rootNode); } return doc; }
@Override public Result getPayloadResult() { NodeList children = document.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { document.removeChild(children.item(i)); } return new DOMResult(document); }
public Result getPayloadResult() { NodeList children = document.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { document.removeChild(children.item(i)); } return new DOMResult(document); }
@Override public Result getPayloadResult() { NodeList children = document.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { document.removeChild(children.item(i)); } return new DOMResult(document); }
@Override public Result getPayloadResult() { NodeList children = document.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { document.removeChild(children.item(i)); } return new DOMResult(document); }
/** * Clear all of the content from the specified document * @param doc */ public static void clearDocument(Document doc) { if (doc == null) { return; } while (doc.hasChildNodes()) { doc.removeChild(doc.getFirstChild()); } }
public void writeStartDocument() throws XMLStreamException { if (result != root) { throw new XMLStreamException("Result node is not the Document"); } // remove all child nodes to reset the document Node child; while ((child = root.getLastChild()) != null) { root.removeChild(child); } namespaceContext = null; }
public void setRoot(Node node) { Node oldRoot = getRoot(); if (oldRoot != null) document.removeChild(oldRoot); document.appendChild(node); }
/** * Transforms federatedCatalogIDs to its DOM representation that is appended to an existing DOM tree. * * @param federatedCatalogIDs * @param parent the federatedCatalogIDs node that will contain the content * @throws SAXException */ public void appendToNode(String[] federatedCatalogIDs, Node parent) throws SAXException { Document doc = toDocument(federatedCatalogIDs); Element root = doc.getDocumentElement(); Node federatedCatalogIDNode = doc.removeChild(root); parent.appendChild(federatedCatalogIDNode); }
/** * Transforms a secured action to its DOM representation that is appended to an existing DOM tree. * * @param securedAction * @param parent the secured action node that will contain the content * @throws SAXException */ public void appendToNode(SecuredAction securedAction, Node parent) throws SAXException { Document doc = toDocument(securedAction); Element root = doc.getDocumentElement(); Node securedActionNode = doc.removeChild(root); parent.appendChild(securedActionNode); }
public String toString() { Document doc = createProfileDocument(); doc.removeChild(doc.getDocumentElement()); doc.appendChild(toXML(doc)); return XML.serialize(doc); }
private static Document extractNotificationContent(Document notification) throws DocumentedException { XmlElement root = XmlElement.fromDomElement(notification.getDocumentElement()); XmlElement content = root.getOnlyChildElement(); notification.removeChild(root.getDomElement()); notification.appendChild(content.getDomElement()); return notification; }
/** * Combine given element. * @param element element to combine */ public void combine(Element element) { Element parent = document.getDocumentElement(); if (parent != null) { document.removeChild(parent); } Context result = combine(Context.fromElement(parent), Context.fromElement(element)); result.addAsChildTo(document); }
public void replaceDocumentType(String docTypeName, String publicId, String systemId) { if (document == null) return; DocumentTypeImpl docType = (DocumentTypeImpl) document.getDoctype(); if (docType == null) return; if (publicId == null && systemId == null) document.removeChild(docType); else { docType.setPublicId(publicId); docType.setSystemId(systemId); } }