home *** CD-ROM | disk | FTP | other *** search
- package com.sun.xml.tree;
-
- import java.io.IOException;
- import java.io.Writer;
- import org.w3c.dom.CDATASection;
- import org.w3c.dom.Node;
-
- class CDataNode extends TextNode implements CDATASection {
- public CDataNode() {
- }
-
- public CDataNode(String var1) {
- super(var1);
- }
-
- public CDataNode(char[] var1, int var2, int var3) {
- super(var1, var2, var3);
- }
-
- public Node cloneNode(boolean var1) {
- CDataNode var2 = new CDataNode(super.data, 0, super.data.length);
- ((NodeBase)var2).setOwnerDocument((XmlDocument)((NodeBase)this).getOwnerDocument());
- return var2;
- }
-
- public String getNodeName() {
- return "#cdata-section";
- }
-
- public short getNodeType() {
- return 4;
- }
-
- public void writeXml(XmlWriteContext var1) throws IOException {
- Writer var2 = var1.getWriter();
- var2.write("<![CDATA[");
-
- for(int var3 = 0; var3 < super.data.length; ++var3) {
- char var4 = super.data[var3];
- if (var4 == ']' && var3 + 2 < super.data.length && super.data[var3 + 1] == ']' && super.data[var3 + 2] == '>') {
- var2.write("]]]]><![CDATA[>");
- } else {
- var2.write(var4);
- }
- }
-
- var2.write("]]>");
- }
- }
-