source: NonGTP/Xerces/xercesc/dom/DOMCDATASection.hpp @ 188

Revision 188, 6.2 KB checked in by mattausch, 19 years ago (diff)

added xercesc to support

Line 
1#ifndef DOMCDataSection_HEADER_GUARD_
2#define DOMCDataSection_HEADER_GUARD_
3
4
5/*
6 * The Apache Software License, Version 1.1
7 *
8 * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
9 * reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 *
15 * 1. Redistributions of source code must retain the above copyright
16 *    notice, this list of conditions and the following disclaimer.
17 *
18 * 2. Redistributions in binary form must reproduce the above copyright
19 *    notice, this list of conditions and the following disclaimer in
20 *    the documentation and/or other materials provided with the
21 *    distribution.
22 *
23 * 3. The end-user documentation included with the redistribution,
24 *    if any, must include the following acknowledgment:
25 *       "This product includes software developed by the
26 *        Apache Software Foundation (http://www.apache.org/)."
27 *    Alternately, this acknowledgment may appear in the software itself,
28 *    if and wherever such third-party acknowledgments normally appear.
29 *
30 * 4. The names "Xerces" and "Apache Software Foundation" must
31 *    not be used to endorse or promote products derived from this
32 *    software without prior written permission. For written
33 *    permission, please contact apache\@apache.org.
34 *
35 * 5. Products derived from this software may not be called "Apache",
36 *    nor may "Apache" appear in their name, without prior written
37 *    permission of the Apache Software Foundation.
38 *
39 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
40 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
41 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
42 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
45 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
46 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
47 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
48 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
49 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50 * SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This software consists of voluntary contributions made by many
54 * individuals on behalf of the Apache Software Foundation, and was
55 * originally based on software copyright (c) 2001, International
56 * Business Machines, Inc., http://www.ibm.com .  For more information
57 * on the Apache Software Foundation, please see
58 * <http://www.apache.org/>.
59 */
60
61/*
62 * $Id: DOMCDATASection.hpp,v 1.6 2003/03/07 19:58:58 tng Exp $
63 */
64
65#include <xercesc/util/XercesDefs.hpp>
66#include "DOMText.hpp"
67
68XERCES_CPP_NAMESPACE_BEGIN
69
70
71/**
72 * CDATA sections are used to escape blocks of text containing characters that
73 * would otherwise be regarded as markup. The only delimiter that is
74 * recognized in a CDATA section is the "]]&gt;" string that ends the CDATA
75 * section. CDATA sections cannot be nested. Their primary purpose is for
76 * including material such as XML fragments, without needing to escape all
77 * the delimiters.
78 * <p>The <code>data</code> attribute of the <code>DOMText</code> node holds
79 * the text that is contained by the CDATA section. Note that this may
80 * contain characters that need to be escaped outside of CDATA sections and
81 * that, depending on the character encoding ("charset") chosen for
82 * serialization, it may be impossible to write out some characters as part
83 * of a CDATA section.
84 * <p>The <code>DOMCDATASection</code> interface inherits from the
85 * <code>DOMCharacterData</code> interface through the <code>DOMText</code>
86 * interface. Adjacent <code>DOMCDATASection</code> nodes are not merged by use
87 * of the <code>normalize</code> method of the <code>DOMNode</code> interface.
88 * Because no markup is recognized within a <code>DOMCDATASection</code>,
89 * character numeric references cannot be used as an escape mechanism when
90 * serializing. Therefore, action needs to be taken when serializing a
91 * <code>DOMCDATASection</code> with a character encoding where some of the
92 * contained characters cannot be represented. Failure to do so would not
93 * produce well-formed XML.One potential solution in the serialization
94 * process is to end the CDATA section before the character, output the
95 * character using a character reference or entity reference, and open a new
96 * CDATA section for any further characters in the text node. Note, however,
97 * that some code conversion libraries at the time of writing do not return
98 * an error or exception when a character is missing from the encoding,
99 * making the task of ensuring that data is not corrupted on serialization
100 * more difficult.
101 * <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>.
102 *
103 * @since DOM Level 1
104 */
105class CDOM_EXPORT DOMCDATASection: public DOMText {
106protected:
107    // -----------------------------------------------------------------------
108    //  Hidden constructors
109    // -----------------------------------------------------------------------
110    /** @name Hidden constructors */
111    //@{   
112    DOMCDATASection() {};
113    //@}
114
115private:
116    // -----------------------------------------------------------------------
117    // Unimplemented constructors and operators
118    // -----------------------------------------------------------------------
119    /** @name Unimplemented constructors and operators */
120    //@{
121    DOMCDATASection(const DOMCDATASection &);
122    DOMCDATASection & operator = (const DOMCDATASection &);
123    //@}
124
125public:
126    // -----------------------------------------------------------------------
127    //  All constructors are hidden, just the destructor is available
128    // -----------------------------------------------------------------------
129    /** @name Destructor */
130    //@{
131    /**
132     * Destructor
133     *
134     */
135    virtual ~DOMCDATASection() {};
136    //@}
137
138};
139
140XERCES_CPP_NAMESPACE_END
141
142#endif
143
144
Note: See TracBrowser for help on using the repository browser.