Examples of createComment()


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

                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

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

                }

                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

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

    protected final void runTest() throws Throwable {
        Document doc = dbf.newDocumentBuilder().newDocument();
        Element newChild = doc.createElementNS(null, "newChild");
        if (newChildHasSiblings) {
            Element parent = doc.createElementNS(null, "parent");
            parent.appendChild(doc.createComment("previous sibling"));
            parent.appendChild(newChild);
            parent.appendChild(doc.createComment("next sibling"));
        }
        runTest(doc, newChild);
    }
View Full Code Here

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

        Element newChild = doc.createElementNS(null, "newChild");
        if (newChildHasSiblings) {
            Element parent = doc.createElementNS(null, "parent");
            parent.appendChild(doc.createComment("previous sibling"));
            parent.appendChild(newChild);
            parent.appendChild(doc.createComment("next sibling"));
        }
        runTest(doc, newChild);
    }

    protected abstract void runTest(Document doc, Node newChild);
View Full Code Here

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

        }
        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

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

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

                }

                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

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

                        continue;
                    }
                    Element propertyElem = UtilXml.addChildElement(resourceElem, "property", resourceDocument);
                    propertyElem.setAttribute("key", StringEscapeUtils.unescapeHtml(labelInfo.getLabelKey()));
                    if (UtilValidate.isNotEmpty(labelInfo.getLabelKeyComment())) {
                        Comment labelKeyComment = resourceDocument.createComment(StringEscapeUtils.unescapeHtml(labelInfo.getLabelKeyComment()));
                        Node parent = propertyElem.getParentNode();
                        parent.insertBefore(labelKeyComment, propertyElem);
                    }
                    for (String localeFound : localesFound) {
                        LabelValue labelValue = labelInfo.getLabelValue(localeFound);
View Full Code Here

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

                            valueElem.setAttribute("xml:lang", localeFound);
                            if (valueString.trim().length() == 0) {
                                valueElem.setAttribute("xml:space", "preserve");
                            }
                            if (UtilValidate.isNotEmpty(labelValue.getLabelComment())) {
                                Comment labelComment = resourceDocument.createComment(StringEscapeUtils.unescapeHtml(labelValue.getLabelComment()));
                                Node parent = valueElem.getParentNode();
                                parent.insertBefore(labelComment, valueElem);
                            }
                        }
                    }
View Full Code Here

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

                }

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