Package org.w3c.dom

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


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

        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

      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

  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

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

            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

            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

                        if (spaceIndex != -1)
                        {
                            desc = desc.substring(spaceIndex + 1);
                        }
                        Element apiDesc = outputObject.createElement("apiDesc");
                        CDATASection cdata = outputObject.createCDATASection(asDocUtil.validateText(desc, "param", record.getAttribute("fullname")));
                        apiDesc.appendChild(cdata);
                        apiParam.appendChild(apiDesc);

                        asDocUtil.convertDescToDITA(apiDesc, oldNewNamesMap);

                        params.appendChild(apiParam);
                        paramFound = true;
                    }
                }
                else if (tagName.equals("param"))
                {
                }
                else if (tagName.equals("includeExample"))
                {
                    includeExamplesFound = true;

                    // get the <example> element after reading the file and
                    // creating a <codeblock>
                    // add the <example> to the detail node..
                    includeExamples.add(processIncludeExampleTag(record.getAttribute("fullname"), child.getTextContent()));
                }
                else if (tagName.equals("tiptext"))
                {
                    tipTextFound = true;

                    Element apiTipText = outputObject.createElement("apiTipText");
                    CDATASection cdata = outputObject.createCDATASection(asDocUtil.validateText(child.getTextContent(), "tiptext", record.getAttribute("fullname")));
                    apiTipText.appendChild(cdata);
                    asDocUtil.convertDescToDITA(apiTipText, oldNewNamesMap);
                    apiTipTexts.appendChild(apiTipText);
                }
                else if (tagName.equals("copy"))
                {
                    String copyRef = child.getTextContent();
                    copyRef = copyRef.replaceAll("[\\n\\s]", "");

                    if (copyRef.equals(""))
                    {
                        continue;
                    }

                    Element shortDescElement = asDocUtil.getElementByTagName(target, "shortdesc");
                    if (shortDescElement == null)
                    {
                        shortDescElement = outputObject.createElement("shortdesc");
                        target.appendChild(shortDescElement);
                    }

                    shortDescElement.setAttribute("conref", copyRef);
                    Element detailNode = asDocUtil.getDetailNode(target);

                    if (detailNode == null)
                    {
                        continue;
                    }

                    Element apiDesc = asDocUtil.getElementImmediateChildByTagName(detailNode, "apiDesc");

                    if (apiDesc != null)
                    {
                        apiDesc.setAttribute("conref", copyRef);
                    }
                }
                else if (tagName.equals("default"))
                {

                    Element apiDefaultValue = outputObject.createElement("apiDefaultValue");
                    apiDefaultValue.setTextContent(child.getTextContent());
                    Element defNode = asDocUtil.getDefNode(target);
                    defNode.appendChild(apiDefaultValue);
                }
                else if (tagName.equals("inheritDoc"))
                {

                    Element apiInheritDoc = outputObject.createElement("apiInheritDoc");
                    target.appendChild(apiInheritDoc);
                }
                else
                {
                    customsFound = true;
                    customData = outputObject.createElement(child.getNodeName());
                    NodeList customsChildren = child.getChildNodes();
                    if (customsChildren != null && customsChildren.getLength() != 0)
                    {
                        if (customsChildren.item(0).getNodeType() == Node.CDATA_SECTION_NODE)
                        {
                            CDATASection cdata = outputObject.createCDATASection(child.getTextContent());
                            cdata.setData(((CDATASection)customsChildren.item(0)).getData());
                            customData.appendChild(cdata);
                        }
                        else
                        {
                            CDATASection cdata = outputObject.createCDATASection(child.getTextContent());
                            customData.appendChild(cdata);
                        }
                    }

                }
View Full Code Here

                    }
                }
            }
            result = outputObject.createElement("example");
            result.setAttribute("conref", exampleFileName);
            CDATASection cdata = outputObject.createCDATASection(asDocUtil.validateText(output.toString(), "includeExample " + exampleStr, fullName));
            result.appendChild(cdata);
            // result.setTextContent(asDocUtil.validateText(output.toString()));
        }

        if (result == null)
View Full Code Here

TOP

Related Classes of org.w3c.dom.CDATASection

Copyright © 2018 www.massapicom. 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.