|
||||
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_DOMDOCUMENTFRAGMENT_HPP) 0023 #define XERCESC_INCLUDE_GUARD_DOMDOCUMENTFRAGMENT_HPP 0024 0025 #include <xercesc/util/XercesDefs.hpp> 0026 #include <xercesc/dom/DOMNode.hpp> 0027 0028 XERCES_CPP_NAMESPACE_BEGIN 0029 0030 0031 /** 0032 * DOMDocumentFragment is a "lightweight" or "minimal" 0033 * DOMDocument object. 0034 * 0035 * It is very common to want to be able to 0036 * extract a portion of a document's tree or to create a new fragment of a 0037 * document. Imagine implementing a user command like cut or rearranging a 0038 * document by moving fragments around. It is desirable to have an object 0039 * which can hold such fragments and it is quite natural to use a DOMNode for 0040 * this purpose. While it is true that a <code>DOMDocument</code> object could 0041 * fulfill this role, a <code>DOMDocument</code> object can potentially be a 0042 * heavyweight object, depending on the underlying implementation. What is 0043 * really needed for this is a very lightweight object. 0044 * <code>DOMDocumentFragment</code> is such an object. 0045 * <p>Furthermore, various operations -- such as inserting nodes as children 0046 * of another <code>DOMNode</code> -- may take <code>DOMDocumentFragment</code> 0047 * objects as arguments; this results in all the child nodes of the 0048 * <code>DOMDocumentFragment</code> being moved to the child list of this node. 0049 * <p>The children of a <code>DOMDocumentFragment</code> node are zero or more 0050 * nodes representing the tops of any sub-trees defining the structure of the 0051 * document. <code>DOMDocumentFragment</code> nodes do not need to be 0052 * well-formed XML documents (although they do need to follow the rules 0053 * imposed upon well-formed XML parsed entities, which can have multiple top 0054 * nodes). For example, a <code>DOMDocumentFragment</code> might have only one 0055 * child and that child node could be a <code>DOMText</code> node. Such a 0056 * structure model represents neither an HTML document nor a well-formed XML 0057 * document. 0058 * <p>When a <code>DOMDocumentFragment</code> is inserted into a 0059 * <code>DOMDocument</code> (or indeed any other <code>DOMNode</code> that may take 0060 * children) the children of the <code>DOMDocumentFragment</code> and not the 0061 * <code>DOMDocumentFragment</code> itself are inserted into the 0062 * <code>DOMNode</code>. This makes the <code>DOMDocumentFragment</code> very 0063 * useful when the user wishes to create nodes that are siblings; the 0064 * <code>DOMDocumentFragment</code> acts as the parent of these nodes so that the 0065 * user can use the standard methods from the <code>DOMNode</code> interface, 0066 * such as <code>insertBefore()</code> and <code>appendChild()</code>. 0067 * 0068 * @since DOM Level 1 0069 */ 0070 0071 class CDOM_EXPORT DOMDocumentFragment: public DOMNode { 0072 protected: 0073 // ----------------------------------------------------------------------- 0074 // Hidden constructors 0075 // ----------------------------------------------------------------------- 0076 /** @name Hidden constructors */ 0077 //@{ 0078 DOMDocumentFragment() {}; 0079 //@} 0080 0081 private: 0082 // ----------------------------------------------------------------------- 0083 // Unimplemented constructors and operators 0084 // ----------------------------------------------------------------------- 0085 /** @name Unimplemented constructors and operators */ 0086 //@{ 0087 DOMDocumentFragment(const DOMDocumentFragment &); 0088 DOMDocumentFragment & operator = (const DOMDocumentFragment &); 0089 //@} 0090 0091 public: 0092 // ----------------------------------------------------------------------- 0093 // All constructors are hidden, just the destructor is available 0094 // ----------------------------------------------------------------------- 0095 /** @name Destructor */ 0096 //@{ 0097 /** 0098 * Destructor 0099 * 0100 */ 0101 virtual ~DOMDocumentFragment() {}; 0102 //@} 0103 0104 }; 0105 0106 XERCES_CPP_NAMESPACE_END 0107 0108 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |