Package org.w3c.dom

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


                    parent.appendChild(doc.createComment(reader.getText()));
                }

                break;
            case XMLStreamConstants.CDATA:
                parent.appendChild(doc.createCDATASection(reader.getText()));

                break;
            case XMLStreamConstants.PROCESSING_INSTRUCTION:
                parent.appendChild(doc.createProcessingInstruction(reader.getPITarget(), reader.getPIData()));
View Full Code Here


            // copy this node
            Node node = null;
            int  type = place.getNodeType();
            switch (type) {
            case Node.CDATA_SECTION_NODE: {
                node = factory.createCDATASection(place.getNodeValue());
                break;
            }
            case Node.COMMENT_NODE: {
                node = factory.createComment(place.getNodeValue());
                break;
View Full Code Here

        // Image Handler to be done
        GenericImageHandler ihandler = new CachedImageHandlerBase64Encoder();
        ctx.setGenericImageHandler(ihandler);

        // Set Style handler
        CDATASection styleSheet = domFactory.createCDATASection("");
        ctx.setStyleHandler(new TestStyleHandler(styleSheet));

        // Set the generator comment
        ctx.setComment("Generated by the Batik Test Framework. Test:\u00e9j");
View Full Code Here

public class TextWholeTextTest extends DOM3Test {
    public boolean runImplBase() throws Exception {
        Document doc = newSVGDoc();
        AbstractText n1 = (AbstractText) doc.createTextNode("abc");
        AbstractText n2 = (AbstractText) doc.createTextNode("def");
        AbstractText n3 = (AbstractText) doc.createCDATASection("ghi");
        doc.getDocumentElement().appendChild(n1);
        doc.getDocumentElement().appendChild(n2);
        doc.getDocumentElement().appendChild(n3);

        return n1.getWholeText().equals("abcdefghi")
View Full Code Here

        doc = newSVGDoc();
        conf = ((AbstractDocument) doc).getDomConfig();
        conf.setParameter("split-cdata-sections", Boolean.TRUE);
        conf.setParameter("error-handler", h);
        e = doc.getDocumentElement();
        e.appendChild(doc.createCDATASection("before ]]> after"));
        ((AbstractDocument) doc).normalizeDocument();
        if (!(e.getFirstChild().getNodeType() == Node.CDATA_SECTION_NODE
                && e.getFirstChild().getNodeValue().equals("before ]]")
                && e.getFirstChild().getNextSibling().getNodeType() == Node.CDATA_SECTION_NODE
                && e.getFirstChild().getNextSibling().getNodeValue().equals("> after")
View Full Code Here

        AbstractElement e = (AbstractElement) doc.getDocumentElement();
        e.appendChild(doc.createTextNode("abc"));
        Element e2 = doc.createElementNS(SVG_NAMESPACE_URI, "text");
        e2.appendChild(doc.createTextNode("def"));
        e.appendChild(e2);
        e.appendChild(doc.createCDATASection("ghi"));
        String s = e.getTextContent();
        e.setTextContent("blah");
        return s.equals("abcdefghi")
                && e.getFirstChild().getNodeType() == Node.TEXT_NODE
                && e.getFirstChild().getNodeValue().equals("blah")
View Full Code Here

public class TextReplaceWholeTextTest extends DOM3Test {
    public boolean runImplBase() throws Exception {
        Document doc = newSVGDoc();
        Text n1 = doc.createTextNode("abc");
        Text n2 = doc.createTextNode("def");
        Text n3 = doc.createCDATASection("ghi");
        doc.getDocumentElement().appendChild(n1);
        doc.getDocumentElement().appendChild(n2);
        doc.getDocumentElement().appendChild(n3);
        ((AbstractText) n2).replaceWholeText("xyz");
View Full Code Here

        Document doc = newSVGDoc();
        DOMConfiguration conf = ((AbstractDocument) doc).getDomConfig();
        conf.setParameter("cdata-sections", Boolean.FALSE);
        Element e = doc.getDocumentElement();
        e.appendChild(doc.createTextNode("abc"));
        e.appendChild(doc.createCDATASection("def"));
        e.appendChild(doc.createTextNode("ghi"));
        ((AbstractDocument) doc).normalizeDocument();
        if (!(e.getFirstChild().getNodeType() == Node.TEXT_NODE
                && e.getFirstChild().getNodeValue().equals("abcdefghi")
                && e.getFirstChild() == e.getLastChild())) {
View Full Code Here

                    parent.appendChild(doc.createComment(reader.getText()));
                }

                break;
            case XMLStreamConstants.CDATA:
                parent.appendChild(doc.createCDATASection(reader.getText()));

                break;
            case XMLStreamConstants.PROCESSING_INSTRUCTION:
                parent.appendChild(doc.createProcessingInstruction(reader.getPITarget(), reader.getPIData()));
View Full Code Here

    case org.w3c.dom.Node.ATTRIBUTE_NODE:
         newNode = doc.createAttributeNS(namespaceURI,
      nodeName);
                     break;
    case org.w3c.dom.Node.CDATA_SECTION_NODE:
         newNode = doc.createCDATASection(value);
                     break;
    case org.w3c.dom.Node.COMMENT_NODE:
         newNode = doc.createComment(value);
                     break;
    case org.w3c.dom.Node.DOCUMENT_FRAGMENT_NODE:
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.