Java XML Element Child Append appendNewComment(Element parentElement, String commentText)

Here you can find the source of appendNewComment(Element parentElement, String commentText)

Description

append New Comment

License

Open Source License

Declaration

public static void appendNewComment(Element parentElement, String commentText) 

Method Source Code

//package com.java2s;

import org.w3c.dom.*;

public class Main {
    public static void appendNewComment(Element parentElement, String commentText) {
        Comment commentNode = parentElement.getOwnerDocument().createComment(commentText);
        parentElement.appendChild(commentNode);
    }/*from   w  w w. j a v a2  s. c o m*/
}

Related

  1. appendChildElement(Element parent, Element el, String[] order)
  2. appendChildElement(Element parentNode, String nodeName)
  3. appendChildElement(final Element parentElement, final String name, final String value)
  4. appendChildElementBoolean(Element parentNode, String tagName, boolean content)
  5. appendChildElmt(Element aElmt, String aChildName)
  6. appendNewElement(Document document, Element parent, Enum el)
  7. appendNewElement(Document document, Element parent, String element, Object content, String namespace)
  8. appendNewElement(Node parent, String elementName)
  9. appendNewElementIfNotNull(Document document, Element parent, Enum el, Object content, String namespace)