Package org.w3c.dom

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


        xpathNodeTracker.visited(attr);
        assertEquals("root element attribute", "/root[1]/@type", xpathNodeTracker.toXpathString());            
               
        xpathNodeTracker.indent();
               
        Comment comment = doc.createComment("testing a comment");
        xpathNodeTracker.visited(comment);
        assertEquals("comment", "/root[1]/comment()[1]", xpathNodeTracker.toXpathString());

        ProcessingInstruction pi = doc.createProcessingInstruction("target","data");
        xpathNodeTracker.visited(pi);
View Full Code Here


            + ") " + ORIGINAL.getDescription();
        assertEquals("Original", originalAsString, ORIGINAL.toString());
       
        Document document = XMLUnit.newControlParser().newDocument();
       
        Node controlNode = document.createComment("control");
        NodeDetail controlNodeDetail = new NodeDetail(controlNode.getNodeValue(),
                                                      controlNode, "/testToString/comment()");
               
        Node testNode = document.createComment("test");
        NodeDetail testNodeDetail = new NodeDetail(testNode.getNodeValue(),
View Full Code Here

       
        Node controlNode = document.createComment("control");
        NodeDetail controlNodeDetail = new NodeDetail(controlNode.getNodeValue(),
                                                      controlNode, "/testToString/comment()");
               
        Node testNode = document.createComment("test");
        NodeDetail testNodeDetail = new NodeDetail(testNode.getNodeValue(),
                                                   testNode, "/testToString/comment()");
               
        Difference difference = new Difference(DifferenceConstants.COMMENT_VALUE,
                                               controlNodeDetail, testNodeDetail);
View Full Code Here

        // Object 2
        Document doc = TestUtils.newDocument();
        Element nc = doc.createElementNS(null, "NonCommentandus");
        nc.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "");
        nc.appendChild(doc.createComment(" Commentandum "));
        objs.add(fac.newXMLObject(Collections.singletonList
            (new DOMStructure(nc)), "object-2", null, null));

  KeyInfo  ki = kifac.newKeyInfo(Collections.singletonList
        (kifac.newKeyValue((PublicKey) VALIDATE_KEYS[1])));
View Full Code Here

      dfactory.setValidating(false);
      dfactory.setNamespaceAware(true);

      DocumentBuilder db = dfactory.newDocumentBuilder();
      Document doc = db.newDocument();
      Comment c1 = doc.createComment("Small Comment Test");

      doc.appendChild(c1);

      Element root = doc.createElementNS(null, "RootElement");
      Element e1 = doc.createElementNS(null, "Element1");
View Full Code Here

                }

                break;
            case XMLStreamConstants.COMMENT:
                if (parent != null) {
                    parent.appendChild(doc.createComment(reader.getText()));
                }

                break;
            case XMLStreamConstants.CDATA:
                parent.appendChild(doc.createCDATASection(reader.getText()));
View Full Code Here

      Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
      Node newChildNode = null;
      boolean format = true;
      switch (nodeType) {
        case Node.COMMENT_NODE : {
          newChildNode = document.createComment(XMLUIMessages._UI_COMMENT_VALUE);
          break;
        }
        case Node.PROCESSING_INSTRUCTION_NODE : {
          newChildNode = document.createProcessingInstruction(XMLUIMessages._UI_PI_TARGET_VALUE, XMLUIMessages._UI_PI_DATA_VALUE);
          break;
View Full Code Here

        Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
        Node newChildNode = null;
        boolean format = true;
        switch (nodeType) {
          case Node.COMMENT_NODE : {
            newChildNode = document.createComment(XMLUIMessages._UI_COMMENT_VALUE);
            break;
          }
          case Node.PROCESSING_INSTRUCTION_NODE : {
            newChildNode = document.createProcessingInstruction(XMLUIMessages._UI_PI_TARGET_VALUE, XMLUIMessages._UI_PI_DATA_VALUE);
            break;
View Full Code Here

                    break;
                case CHARACTERS:
                    current.appendChild(document.createTextNode(reader.getText()));
                    break;
                case COMMENT:
                    current.appendChild(document.createComment(reader.getText()));
                    break;
                case END_ELEMENT:
                    // pop the element off the stack
                    current = current.getParentNode();
                    // if we are back at the root then we are done
View Full Code Here

            case Node.CDATA_SECTION_NODE: {
                node = factory.createCDATASection(place.getNodeValue());
                break;
            }
            case Node.COMMENT_NODE: {
                node = factory.createComment(place.getNodeValue());
                break;
            }
            case Node.ELEMENT_NODE: {
                Element element = factory.createElement(place.getNodeName());
                node = element;
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.