01: // Copyright (c) 2004 Per M.A. Bothner.
02: // This is free software; for terms and warranty disclaimer see ./COPYING.
03:
04: package gnu.kawa.xml;
05:
06: import gnu.xml.*;
07:
08: /* #ifdef use:org.w3c.dom.Node */
09: // import org.w3c.dom.*;
10: /* #endif */
11:
12: public class KCDATASection extends KText
13: /* #ifdef use:org.w3c.dom.Node */
14: // implements org.w3c.dom.CDATASection
15: /* #endif */
16: {
17: public KCDATASection(NodeTree seq, int ipos) {
18: super (seq, ipos);
19: }
20:
21: /* #ifdef use:org.w3c.dom.Node */
22: // public short getNodeType () { return Node.CDATA_SECTION_NODE; }
23: /* #endif */
24:
25: public String getNodeName() {
26: return "#cdata-section";
27: }
28:
29: public String getData() {
30: return getNodeValue();
31: }
32:
33: /** Non-optimized. */
34: public int getLength() {
35: StringBuffer sbuf = new StringBuffer();
36: NodeTree tlist = (NodeTree) sequence;
37: tlist.stringValue(tlist.posToDataIndex(ipos), sbuf);
38: return sbuf.length();
39: }
40:
41: }
|