source: icXML/icXML-devel/src/xercesc/dom/DOMCDATASection.hpp @ 6297

Last change on this file since 6297 was 2722, checked in by cameron, 7 years ago

Original Xerces files with import mods for icxercesc

File size: 4.3 KB
Line 
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id: DOMCDATASection.hpp 527149 2007-04-10 14:56:39Z amassari $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_DOMCDATASECTION_HPP)
23#define XERCESC_INCLUDE_GUARD_DOMCDATASECTION_HPP
24
25#include <xercesc/util/XercesDefs.hpp>
26#include <xercesc/dom/DOMText.hpp>
27
28XERCES_CPP_NAMESPACE_BEGIN
29
30
31/**
32 * CDATA sections are used to escape blocks of text containing characters that
33 * would otherwise be regarded as markup. The only delimiter that is
34 * recognized in a CDATA section is the "]]&gt;" string that ends the CDATA
35 * section. CDATA sections cannot be nested. Their primary purpose is for
36 * including material such as XML fragments, without needing to escape all
37 * the delimiters.
38 * <p>The <code>data</code> attribute of the <code>DOMText</code> node holds
39 * the text that is contained by the CDATA section. Note that this may
40 * contain characters that need to be escaped outside of CDATA sections and
41 * that, depending on the character encoding ("charset") chosen for
42 * serialization, it may be impossible to write out some characters as part
43 * of a CDATA section.
44 * <p>The <code>DOMCDATASection</code> interface inherits from the
45 * <code>DOMCharacterData</code> interface through the <code>DOMText</code>
46 * interface. Adjacent <code>DOMCDATASection</code> nodes are not merged by use
47 * of the <code>normalize</code> method of the <code>DOMNode</code> interface.
48 * Because no markup is recognized within a <code>DOMCDATASection</code>,
49 * character numeric references cannot be used as an escape mechanism when
50 * serializing. Therefore, action needs to be taken when serializing a
51 * <code>DOMCDATASection</code> with a character encoding where some of the
52 * contained characters cannot be represented. Failure to do so would not
53 * produce well-formed XML.One potential solution in the serialization
54 * process is to end the CDATA section before the character, output the
55 * character using a character reference or entity reference, and open a new
56 * CDATA section for any further characters in the text node. Note, however,
57 * that some code conversion libraries at the time of writing do not return
58 * an error or exception when a character is missing from the encoding,
59 * making the task of ensuring that data is not corrupted on serialization
60 * more difficult.
61 * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
62 *
63 * @since DOM Level 1
64 */
65class CDOM_EXPORT DOMCDATASection: public DOMText {
66protected:
67    // -----------------------------------------------------------------------
68    //  Hidden constructors
69    // -----------------------------------------------------------------------
70    /** @name Hidden constructors */
71    //@{   
72    DOMCDATASection() {}
73    DOMCDATASection(const DOMCDATASection &other) : DOMText(other) {}
74    //@}
75
76private:
77    // -----------------------------------------------------------------------
78    // Unimplemented constructors and operators
79    // -----------------------------------------------------------------------
80    /** @name Unimplemented operators */
81    //@{
82    DOMCDATASection & operator = (const DOMCDATASection &);
83    //@}
84
85public:
86    // -----------------------------------------------------------------------
87    //  All constructors are hidden, just the destructor is available
88    // -----------------------------------------------------------------------
89    /** @name Destructor */
90    //@{
91    /**
92     * Destructor
93     *
94     */
95    virtual ~DOMCDATASection() {};
96    //@}
97
98};
99
100XERCES_CPP_NAMESPACE_END
101
102#endif
103
104
Note: See TracBrowser for help on using the repository browser.