Examples of CDATASection


Examples of org.w3c.dom.CDATASection

     * @throws SAXException
     */
    private void writeElement(XmlWriter writer, Node node) throws IOException,
            SAXException {
        if (node instanceof CDATASection) {
            CDATASection section = (CDATASection) node;
            writer.getWriter().write("<![CDATA[");
            writer.getWriter().write(section.getData());
            writer.getWriter().write("]]>");
        } else if (node instanceof Text) {
            Text text = (Text) node;
            writer.getWriter().write(text.getNodeValue());
        } else if (node instanceof EntityReference) {
View Full Code Here

Examples of org.w3c.dom.CDATASection

        }
    }

    protected void setNodeValue(Element node, String nodeValue) {
        if (nodeValue != null) {
            CDATASection section = node.getOwnerDocument().createCDATASection(nodeValue);
            node.appendChild(section);
        }
    }
View Full Code Here

Examples of org.w3c.dom.CDATASection

        parent.appendChild(elem);
        return elem;
    }

    private Object cdata(String content, Element parent) {
        CDATASection section = factory.createCDATASection(content);
        parent.appendChild(section);
        return section;
    }
View Full Code Here

Examples of org.w3c.dom.CDATASection

      urlElement.setTextContent(URLEncoder.encode(_url, "UTF-8"));
      //urlElement.setTextContent(_url);
      podcastElement.appendChild(urlElement);
     
      Element dataElement = document.createElement(DATA_TAG);
      CDATASection dataSection = document.createCDATASection(DATA_TAG);
      dataSection.setData(URLEncoder.encode(_data, "UTF-8"));
      //dataSection.setData(_data);
      dataElement.appendChild(dataSection);
      podcastElement.appendChild(dataElement);
     
      Element podcastItems = document.createElement(ITEMS_TAG);
View Full Code Here

Examples of org.w3c.dom.CDATASection

     
      // <info> element
      NodeList elems = p_post.getElementsByTagName(INFO_TAGNAME);
      if (elems.getLength() > 0) {
        Element elem = (Element)elems.item(0);
        CDATASection cdata = (CDATASection)elem.getFirstChild();
        if (cdata != null)
          setInfo(cdata.getData());
      }
     
      // <message> element
      elems = p_post.getElementsByTagName(MESSAGE_TAGNAME);
      if (elems.getLength() > 0) {
        Element elem = (Element)elems.item(0);
        CDATASection cdata = (CDATASection)elem.getFirstChild();
        if (cdata != null)
          setRawMessage(cdata.getData());
      }
     
      // <login> element
      elems = p_post.getElementsByTagName(LOGIN_TAGNAME);
      if (elems.getLength() > 0) {
        Element elem = (Element)elems.item(0);
        CDATASection cdata = (CDATASection)elem.getFirstChild();
        if (cdata != null)
          setLogin(cdata.getData());
      }
    }
    else
      throw new BadPostException("The element is not a <" + POST_TAGNAME + ">");
  }
View Full Code Here

Examples of org.w3c.dom.CDATASection

                case Node.TEXT_NODE:
                    Text t = doc.createTextNode(n.getNodeValue());
                    documentationEl.appendChild(t);
                    break;
                case Node.CDATA_SECTION_NODE:
                    CDATASection s = doc.createCDATASection(n.getNodeValue());
                    documentationEl.appendChild(s);
                    break;
                case Node.COMMENT_NODE:
                    Comment c = doc.createComment(n.getNodeValue());
                    documentationEl.appendChild(c);
View Full Code Here

Examples of org.w3c.dom.CDATASection

                String nValue = n.getNodeValue();
                Text t = doc.createTextNode(nValue);
                el.appendChild(t);
            } else if (nodeType == Node.CDATA_SECTION_NODE) {
                String nValue = n.getNodeValue();
                CDATASection s = doc.createCDATASection(nValue);
                el.appendChild(s);
            } else if (nodeType == Node.ELEMENT_NODE) {
                appendElement(doc, el, n, schema);
            }
        }
View Full Code Here

Examples of org.w3c.dom.CDATASection

        lastWasEntity = false;
      }
      break;
      case Node.CDATA_SECTION_NODE: {
        indentWithWhitespace();
        CDATASection cd = currentDocument.createCDATASection(name);
//System.out.println("using literal CDATAxection");
        currentNode.appendChild(cd);
        lastWasEntity = false;
      }
      break;
View Full Code Here

Examples of org.w3c.dom.CDATASection

        lastWasEntity = false;
      }
      break;
      case Node.CDATA_SECTION_NODE: {
        indentWithWhitespace();
        CDATASection cd = currentDocument.createCDATASection(name);
//System.out.println("using literal CDATAxection");
        currentNode.appendChild(cd);
        lastWasEntity = false;
      }
      break;
View Full Code Here

Examples of org.w3c.dom.CDATASection

                css = DEFAULT_CSS;
            }
            styleSheet = css;
        }

        CDATASection cdata = document.createCDATASection(styleSheet);
        style.appendChild(cdata);

        return style;
    }
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.