KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > dom > CDATASectionImpl


1 /*
2  * Copyright 1999-2002,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.xerces.dom;
18
19 import org.w3c.dom.CDATASection JavaDoc;
20 import org.w3c.dom.Node JavaDoc;
21
22 /**
23  * XML provides the CDATA markup to allow a region of text in which
24  * most of the XML delimiter recognition does not take place. This is
25  * intended to ease the task of quoting XML fragments and other
26  * programmatic information in a document's text without needing to
27  * escape these special characters. It's primarily a convenience feature
28  * for those who are hand-editing XML.
29  * <P>
30  * CDATASection is an Extended DOM feature, and is not used in HTML
31  * contexts.
32  * <P>
33  * Within the DOM, CDATASections are treated essentially as Text
34  * blocks. Their distinct type is retained in order to allow us to
35  * properly recreate the XML syntax when we write them out.
36  * <P>
37  * Reminder: CDATA IS NOT A COMPLETELY GENERAL SOLUTION; it can't
38  * quote its own end-of-block marking. If you need to write out a
39  * CDATA that contains the ]]> sequence, it's your responsibility to
40  * split that string over two successive CDATAs at that time.
41  * <P>
42  * CDATA does not participate in Element.normalize() processing.
43  *
44  * @xerces.internal
45  *
46  * @version $Id: CDATASectionImpl.java,v 1.8 2004/10/05 17:12:50 mrglavas Exp $
47  * @since PR-DOM-Level-1-19980818.
48  */

49 public class CDATASectionImpl
50     extends TextImpl
51     implements CDATASection JavaDoc {
52
53     //
54
// Constants
55
//
56

57     /** Serialization version. */
58     static final long serialVersionUID = 2372071297878177780L;
59
60     //
61
// Constructors
62
//
63

64     /** Factory constructor for creating a CDATA section. */
65     public CDATASectionImpl(CoreDocumentImpl ownerDoc, String JavaDoc data) {
66         super(ownerDoc, data);
67     }
68     
69     //
70
// Node methods
71
//
72

73     /**
74      * A short integer indicating what type of node this is. The named
75      * constants for this value are defined in the org.w3c.dom.Node interface.
76      */

77     public short getNodeType() {
78         return Node.CDATA_SECTION_NODE;
79     }
80   
81     /** Returns the node name. */
82     public String JavaDoc getNodeName() {
83         return "#cdata-section";
84     }
85
86 } // class CDATASectionImpl
87
Popular Tags