source: icXML/icXML-devel/src/xercesc/dom/DOMDocumentFragment.hpp

Last change on this file was 2722, checked in by cameron, 6 years ago

Original Xerces files with import mods for icxercesc

File size: 4.6 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: DOMDocumentFragment.hpp 932887 2010-04-11 13:04:59Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTFRAGMENT_HPP)
23#define XERCESC_INCLUDE_GUARD_DOMDOCUMENTFRAGMENT_HPP
24
25#include <xercesc/util/XercesDefs.hpp>
26#include <xercesc/dom/DOMNode.hpp>
27
28XERCES_CPP_NAMESPACE_BEGIN
29
30
31/**
32 * DOMDocumentFragment is a "lightweight" or "minimal"
33 * DOMDocument object.
34 *
35 * It is very common to want to be able to
36 * extract a portion of a document's tree or to create a new fragment of a
37 * document. Imagine implementing a user command like cut or rearranging a
38 * document by moving fragments around. It is desirable to have an object
39 * which can hold such fragments and it is quite natural to use a DOMNode for
40 * this purpose. While it is true that a <code>DOMDocument</code> object could
41 * fulfill this role,  a <code>DOMDocument</code> object can potentially be a
42 * heavyweight  object, depending on the underlying implementation. What is
43 * really needed for this is a very lightweight object.
44 * <code>DOMDocumentFragment</code> is such an object.
45 * <p>Furthermore, various operations -- such as inserting nodes as children
46 * of another <code>DOMNode</code> -- may take <code>DOMDocumentFragment</code>
47 * objects as arguments;  this results in all the child nodes of the
48 * <code>DOMDocumentFragment</code>  being moved to the child list of this node.
49 * <p>The children of a <code>DOMDocumentFragment</code> node are zero or more
50 * nodes representing the tops of any sub-trees defining the structure of the
51 * document. <code>DOMDocumentFragment</code> nodes do not need to be
52 * well-formed XML documents (although they do need to follow the rules
53 * imposed upon well-formed XML parsed entities, which can have multiple top
54 * nodes).  For example, a <code>DOMDocumentFragment</code> might have only one
55 * child and that child node could be a <code>DOMText</code> node. Such a
56 * structure model  represents neither an HTML document nor a well-formed XML
57 * document.
58 * <p>When a <code>DOMDocumentFragment</code> is inserted into a
59 * <code>DOMDocument</code> (or indeed any other <code>DOMNode</code> that may take
60 * children) the children of the <code>DOMDocumentFragment</code> and not the
61 * <code>DOMDocumentFragment</code>  itself are inserted into the
62 * <code>DOMNode</code>. This makes the <code>DOMDocumentFragment</code> very
63 * useful when the user wishes to create nodes that are siblings; the
64 * <code>DOMDocumentFragment</code> acts as the parent of these nodes so that the
65 *  user can use the standard methods from the <code>DOMNode</code>  interface,
66 * such as <code>insertBefore()</code> and  <code>appendChild()</code>.
67 *
68 * @since DOM Level 1
69 */
70
71class CDOM_EXPORT DOMDocumentFragment: public DOMNode {
72protected:
73    // -----------------------------------------------------------------------
74    //  Hidden constructors
75    // -----------------------------------------------------------------------
76    /** @name Hidden constructors */
77    //@{   
78    DOMDocumentFragment() {};
79    //@}
80
81private:
82    // -----------------------------------------------------------------------
83    // Unimplemented constructors and operators
84    // -----------------------------------------------------------------------
85    /** @name Unimplemented constructors and operators */
86    //@{
87    DOMDocumentFragment(const DOMDocumentFragment &);
88    DOMDocumentFragment & operator = (const DOMDocumentFragment &);
89    //@}
90
91public:
92    // -----------------------------------------------------------------------
93    //  All constructors are hidden, just the destructor is available
94    // -----------------------------------------------------------------------
95    /** @name Destructor */
96    //@{
97    /**
98     * Destructor
99     *
100     */
101    virtual ~DOMDocumentFragment() {};
102        //@}
103
104};
105
106XERCES_CPP_NAMESPACE_END
107
108#endif
Note: See TracBrowser for help on using the repository browser.