Package org.w3c.dom

Examples of org.w3c.dom.Document.createComment()


        Document signedDoc = builder.build(doc, crypto, secHeader);
       
        // Add a comment node as the first node element
        org.w3c.dom.Node firstChild = signedDoc.getFirstChild();
        org.w3c.dom.Node newNode = signedDoc.removeChild(firstChild);
        org.w3c.dom.Node commentNode = signedDoc.createComment("This is a comment");
        signedDoc.appendChild(commentNode);
        signedDoc.appendChild(newNode);

        if (LOG.isDebugEnabled()) {
            LOG.debug("After Signing....");
View Full Code Here


        switch (child.getNodeType()) {
        case Node.CDATA_SECTION_NODE:
            copy = doc.createCDATASection(((CDATASection) child).getData());
            break;
        case Node.COMMENT_NODE:
            copy = doc.createComment(((Comment) child).getData());
            break;
        case Node.DOCUMENT_FRAGMENT_NODE:
            copy = doc.createDocumentFragment();
            break;
        case Node.ELEMENT_NODE:
View Full Code Here

      }
      Element propNode = doc.createElement("property");
      conf.appendChild(propNode);

      if (updatingResource != null) {
        Comment commentNode = doc.createComment(
          "Loaded from " + updatingResource.get(name));
        propNode.appendChild(commentNode);
      }
      Element nameNode = doc.createElement("name");
      nameNode.appendChild(doc.createTextNode(name));
View Full Code Here

        switch (child.getNodeType()) {
        case Node.CDATA_SECTION_NODE:
            copy = doc.createCDATASection(((CDATASection) child).getData());
            break;
        case Node.COMMENT_NODE:
            copy = doc.createComment(((Comment) child).getData());
            break;
        case Node.DOCUMENT_FRAGMENT_NODE:
            copy = doc.createDocumentFragment();
            break;
        case Node.ELEMENT_NODE:
View Full Code Here

      }
      Element propNode = doc.createElement("property");
      conf.appendChild(propNode);

      if (updatingResource != null) {
        Comment commentNode = doc.createComment(
          "Loaded from " + updatingResource.get(name));
        propNode.appendChild(commentNode);
      }
      Element nameNode = doc.createElement("name");
      nameNode.appendChild(doc.createTextNode(name));
View Full Code Here

    public void testCommentNode() throws Exception {
        //CXF-3034
        Document document = DocumentBuilderFactory.newInstance()
            .newDocumentBuilder().newDocument();
        Element root = document.createElementNS("urn:test", "root");
        root.appendChild(document.createComment("test comment"));
        StaxUtils.copy(StaxUtils.createXMLStreamReader(root), StaxUtils.createXMLStreamWriter(System.out));
    }
    @Test
    public void testToNextElement() {
        String soapMessage = "./resources/sayHiRpcLiteralReq.xml";
View Full Code Here

                stack.getFirst().appendChild(textNode);
            } else if (event == CDATA) {
                CDATASection cdataSection = document.createCDATASection(getText());
                stack.getFirst().appendChild(cdataSection);
            } else if (event == COMMENT) {
                Comment comment = document.createComment(getText());
                stack.getFirst().appendChild(comment);
            } else if (event == SPACE) {
            } else if (event == START_DOCUMENT) {
            } else if (event == END_DOCUMENT) {
            } else if (event == PROCESSING_INSTRUCTION) {
View Full Code Here

     */
    public Document generate() throws ConfigurationException {
        Document doc = YADOMUtil.createDocument();
        Element root;

        doc.appendChild(doc.createComment("\n\tNOTE: DO NOT MODIFY\n\tThis file was auto-generated.\n"));
        root = YADOMUtil.addElement(doc, "jbossesb-gateways");
        root.setAttribute("parameterReloadSecs", model.getParameterReloadSecs());

        List<Service> services = model.getServices();
        HashMap<String, HashMap<String, String>> hm = new HashMap<String, HashMap<String, String>>();
View Full Code Here

   */
  public Document generate() throws ConfigurationException {
    Document doc = YADOMUtil.createDocument();
    Element root;

    doc.appendChild(doc.createComment("\n\tNOTE: DO NOT MODIFY\n\tThis file was auto-generated.\n"));
    root = YADOMUtil.addElement(doc, "jbossesb-listeners");
    root.setAttribute("parameterReloadSecs", model.getParameterReloadSecs());

        // Add an InVM listener for each service...
        List<Service> services = model.getServices();
View Full Code Here

      switch (token.intValue()) {
      case TokenType.INT_ATTR:
        toElement.setAttribute(cursor.getName().getLocalPart(), cursor.getTextValue());
        break;
      case TokenType.INT_COMMENT:
        toElement.appendChild(doc.createComment(cursor.getTextValue()));
        break;
      case TokenType.INT_START:
        Element childElement = doc.createElement(cursor.getName().getLocalPart());
        toElement.appendChild(childElement);
        serialize(cursor, childElement);
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.