1 | #ifndef DOMCDataSection_HEADER_GUARD_
|
---|
2 | #define DOMCDataSection_HEADER_GUARD_
|
---|
3 |
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright 2001-2002,2004 The Apache Software Foundation.
|
---|
7 | *
|
---|
8 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
9 | * you may not use this file except in compliance with the License.
|
---|
10 | * You may obtain a copy of the License at
|
---|
11 | *
|
---|
12 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
13 | *
|
---|
14 | * Unless required by applicable law or agreed to in writing, software
|
---|
15 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
17 | * See the License for the specific language governing permissions and
|
---|
18 | * limitations under the License.
|
---|
19 | */
|
---|
20 |
|
---|
21 | /*
|
---|
22 | * $Id: DOMCDATASection.hpp,v 1.8 2004/09/26 15:38:02 gareth Exp $
|
---|
23 | */
|
---|
24 |
|
---|
25 | #include <xercesc/util/XercesDefs.hpp>
|
---|
26 | #include <xercesc/dom/DOMText.hpp>
|
---|
27 |
|
---|
28 | XERCES_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 "]]>" 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 | */
|
---|
65 | class CDOM_EXPORT DOMCDATASection: public DOMText {
|
---|
66 | protected:
|
---|
67 | // -----------------------------------------------------------------------
|
---|
68 | // Hidden constructors
|
---|
69 | // -----------------------------------------------------------------------
|
---|
70 | /** @name Hidden constructors */
|
---|
71 | //@{
|
---|
72 | DOMCDATASection() {};
|
---|
73 | //@}
|
---|
74 |
|
---|
75 | private:
|
---|
76 | // -----------------------------------------------------------------------
|
---|
77 | // Unimplemented constructors and operators
|
---|
78 | // -----------------------------------------------------------------------
|
---|
79 | /** @name Unimplemented constructors and operators */
|
---|
80 | //@{
|
---|
81 | DOMCDATASection(const DOMCDATASection &);
|
---|
82 | DOMCDATASection & operator = (const DOMCDATASection &);
|
---|
83 | //@}
|
---|
84 |
|
---|
85 | public:
|
---|
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 |
|
---|
100 | XERCES_CPP_NAMESPACE_END
|
---|
101 |
|
---|
102 | #endif
|
---|
103 |
|
---|
104 |
|
---|