Examples of CDATASection


Examples of org.w3c.dom.CDATASection

    }

    public void testCompareCDATA() throws Exception {
        String expected = CDATA_A ;
        String actual = CDATA_B ;
        CDATASection control = document.createCDATASection(expected);
        CDATASection test = document.createCDATASection(actual);

        assertDifferentCDATA(control, test, CDATA_VALUE);
    }
View Full Code Here

Examples of org.w3c.dom.CDATASection

        Text text = doc.createTextNode("some text");
        xpathNodeTracker.visited(text);
        assertEquals("text", "/root[1]/text()[1]", xpathNodeTracker.toXpathString());

        CDATASection cdata = doc.createCDATASection("some characters");
        xpathNodeTracker.visited(cdata);
        assertEquals("cdata", "/root[1]/text()[2]", xpathNodeTracker.toXpathString());
    }
View Full Code Here

Examples of org.w3c.dom.CDATASection

     */
    protected CDATASection createCDATASectionWrapper(CDATASection c) {
        if (c == null) {
            return null;
        }
        CDATASection result = (CDATASection)getNode(c);
        if (result == null) {
            result = new CDATASectionWrapper(this, c);
            nodes.put(c, new WeakReference(result));
        }
        return result;
View Full Code Here

Examples of org.w3c.dom.CDATASection

       && com.sun.org.apache.xml.internal.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length))
      return// avoid DOM006 Hierarchy request error

    String s = new String(ch, start, length);

    CDATASection section  =(CDATASection) m_currentNode.getLastChild();
    section.appendData(s);
  }
View Full Code Here

Examples of org.w3c.dom.CDATASection

        byte[] data = "<element><![CDATA[ here's the text ]]></element>".getBytes();
        org.w3c.dom.Document doc = builder.parse(new ByteArrayInputStream(data));
         
        org.w3c.dom.Element root = doc.getDocumentElement();
        CDATASection node = (CDATASection) (root.getChildNodes().item(0));
        Text text = DOMConverter.convert(node);
        assertEquals(node.getNodeValue(), text.getValue());  
       
        // Now test indirect conversion
        Document xomDoc = DOMConverter.convert(doc);
        assertEquals(node.getNodeValue(), xomDoc.getValue());
                
    }
View Full Code Here

Examples of org.w3c.dom.CDATASection

      m_doc = docBuilder.newDocument();

      Element etmp = null;
      Text text = null;
      CDATASection cdata = null;

      Element root = m_doc.createElement("ext-error");
      m_doc.appendChild(root);

View Full Code Here

Examples of org.w3c.dom.CDATASection

  protected void populateSpecificData(Document doc, Node n)
  {
    Element etmp = null;
    Text text = null;
    CDATASection cdata = null;

    Element root = doc.createElement("sql-error");
    n.appendChild(root);

View Full Code Here

Examples of org.w3c.dom.CDATASection

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

Examples of org.w3c.dom.CDATASection

            apiPackageElement.appendChild(shortDescElement);

            Element apiDetailElement = outputObject.createElement("apiDetail");
            Element apiDescElement = outputObject.createElement("apiDesc");

            CDATASection cdata = outputObject.createCDATASection(asDocUtil.validateText(description, "description", packageName));
            apiDescElement.appendChild(cdata);

            apiDetailElement.appendChild(apiDescElement);
            apiPackageElement.appendChild(apiDetailElement);
View Full Code Here

Examples of org.w3c.dom.CDATASection

            shortdesc.setTextContent(asDocUtil.descToShortDesc(fullDesc));

            Element apiDesc = outputObject.createElement("apiDesc");

            CDATASection cdata = outputObject.createCDATASection(asDocUtil.validateText(fullDesc, "description", fullName));
            apiDesc.appendChild(cdata);

            apiClassifierDetail.appendChild(apiDesc);

            asDocUtil.convertDescToDITA(apiDesc, oldNewNamesMap);
        }

        Element apiAccess = outputObject.createElement("apiAccess");
        apiAccess.setAttribute("value", accessLevel);
        apiClassifierDef.appendChild(apiAccess);

        if (isDynamic.equals("true"))
        {
            Element apiDynamic = outputObject.createElement("apiDynamic");
            apiClassifierDef.appendChild(apiDynamic);
        }
        else
        {
            Element apiStatic = outputObject.createElement("apiStatic");
            apiClassifierDef.appendChild(apiStatic);
        }

        if (isFinal.equals("true"))
        {
            Element apiFinal = outputObject.createElement("apiFinal");
            apiClassifierDef.appendChild(apiFinal);
        }

        if (!author.equals(""))
        {
            Element tempAuthorElement = outputObject.createElement("author");
            tempAuthorElement.setTextContent(author);
            prolog.appendChild(tempAuthorElement);
        }

        Element asMetadata = outputObject.createElement("asMetadata");
        prolog.appendChild(asMetadata);

        processVersions(record, nuClass);

        NodeList nodeList = record.getElementsByTagName("example");
        if (nodeList != null)
        {
            for (int ix = 0; ix < nodeList.getLength(); ix++)
            {
                Element inputExampleElement = (Element)nodeList.item(ix);

                Element exampleElement = outputObject.createElement("example");
                CDATASection cdata = outputObject.createCDATASection(asDocUtil.validateText(inputExampleElement.getTextContent(), "example", fullName));
                exampleElement.appendChild(cdata);

                apiClassifierDetail.appendChild(exampleElement);

                asDocUtil.convertDescToDITA(exampleElement, oldNewNamesMap);
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.