Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:50

0001 /*
0002  * Licensed to the Apache Software Foundation (ASF) under one or more
0003  * contributor license agreements.  See the NOTICE file distributed with
0004  * this work for additional information regarding copyright ownership.
0005  * The ASF licenses this file to You under the Apache License, Version 2.0
0006  * (the "License"); you may not use this file except in compliance with
0007  * the License.  You may obtain a copy of the License at
0008  * 
0009  *      http://www.apache.org/licenses/LICENSE-2.0
0010  * 
0011  * Unless required by applicable law or agreed to in writing, software
0012  * distributed under the License is distributed on an "AS IS" BASIS,
0013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014  * See the License for the specific language governing permissions and
0015  * limitations under the License.
0016  */
0017 
0018 /*
0019  * $Id$
0020  */
0021 
0022 #if !defined(XERCESC_INCLUDE_GUARD_DOMCDATASECTION_HPP)
0023 #define XERCESC_INCLUDE_GUARD_DOMCDATASECTION_HPP
0024 
0025 #include <xercesc/util/XercesDefs.hpp>
0026 #include <xercesc/dom/DOMText.hpp>
0027 
0028 XERCES_CPP_NAMESPACE_BEGIN
0029 
0030 
0031 /**
0032  * CDATA sections are used to escape blocks of text containing characters that
0033  * would otherwise be regarded as markup. The only delimiter that is
0034  * recognized in a CDATA section is the "]]&gt;" string that ends the CDATA
0035  * section. CDATA sections cannot be nested. Their primary purpose is for
0036  * including material such as XML fragments, without needing to escape all
0037  * the delimiters.
0038  * <p>The <code>data</code> attribute of the <code>DOMText</code> node holds
0039  * the text that is contained by the CDATA section. Note that this may
0040  * contain characters that need to be escaped outside of CDATA sections and
0041  * that, depending on the character encoding ("charset") chosen for
0042  * serialization, it may be impossible to write out some characters as part
0043  * of a CDATA section.
0044  * <p>The <code>DOMCDATASection</code> interface inherits from the
0045  * <code>DOMCharacterData</code> interface through the <code>DOMText</code>
0046  * interface. Adjacent <code>DOMCDATASection</code> nodes are not merged by use
0047  * of the <code>normalize</code> method of the <code>DOMNode</code> interface.
0048  * Because no markup is recognized within a <code>DOMCDATASection</code>,
0049  * character numeric references cannot be used as an escape mechanism when
0050  * serializing. Therefore, action needs to be taken when serializing a
0051  * <code>DOMCDATASection</code> with a character encoding where some of the
0052  * contained characters cannot be represented. Failure to do so would not
0053  * produce well-formed XML.One potential solution in the serialization
0054  * process is to end the CDATA section before the character, output the
0055  * character using a character reference or entity reference, and open a new
0056  * CDATA section for any further characters in the text node. Note, however,
0057  * that some code conversion libraries at the time of writing do not return
0058  * an error or exception when a character is missing from the encoding,
0059  * making the task of ensuring that data is not corrupted on serialization
0060  * more difficult.
0061  * <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>.
0062  *
0063  * @since DOM Level 1
0064  */
0065 class CDOM_EXPORT DOMCDATASection: public DOMText {
0066 protected:
0067     // -----------------------------------------------------------------------
0068     //  Hidden constructors
0069     // -----------------------------------------------------------------------
0070     /** @name Hidden constructors */
0071     //@{    
0072     DOMCDATASection() {}
0073     DOMCDATASection(const DOMCDATASection &other) : DOMText(other) {}
0074     //@}
0075 
0076 private:
0077     // -----------------------------------------------------------------------
0078     // Unimplemented constructors and operators
0079     // -----------------------------------------------------------------------
0080     /** @name Unimplemented operators */
0081     //@{
0082     DOMCDATASection & operator = (const DOMCDATASection &);
0083     //@}
0084 
0085 public:
0086     // -----------------------------------------------------------------------
0087     //  All constructors are hidden, just the destructor is available
0088     // -----------------------------------------------------------------------
0089     /** @name Destructor */
0090     //@{
0091     /**
0092      * Destructor
0093      *
0094      */
0095     virtual ~DOMCDATASection() {};
0096     //@}
0097 
0098 };
0099 
0100 XERCES_CPP_NAMESPACE_END
0101 
0102 #endif
0103 
0104