NCBI C++ ToolKit
document_impl.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /*
2  * Copyright (C) 2001-2003 Peter J Jones (pjones@pmade.org)
3  * All Rights Reserved
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * 3. Neither the name of the Author nor the names of its contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
23  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30  * SUCH DAMAGE.
31  */
32 
33 /*
34  * $Id: document_impl.hpp 66006 2015-01-21 17:09:53Z satskyse $
35  * NOTE: This file was modified from its original version 0.6.0
36  * to fit the NCBI C++ Toolkit build framework and
37  * API and functionality requirements.
38  */
39 
40 
41 #ifndef _xmlwrapp_document_impl_h_
42 #define _xmlwrapp_document_impl_h_
43 
44 
45 // xmlwrapp includes
46 #include <misc/xmlwrapp/node.hpp>
47 #include <misc/xmlwrapp/dtd.hpp>
48 #include "node_manip.hpp"
49 
50 // standard includes
51 #include <string>
52 
53 // libxml includes
54 #include <libxml/tree.h>
55 #include <libxml/xinclude.h>
56 #include <libxslt/xslt.h>
57 #include <libxslt/xsltInternals.h>
58 
59 
60 namespace xml {
61 namespace impl {
62 
63 struct doc_impl {
64  doc_impl (void);
65  doc_impl (const char *root_name);
66  doc_impl (const doc_impl &other);
67  void set_doc_data (xmlDocPtr newdoc, bool root_is_okay);
68  void set_root_node (const node &n);
69  void set_ownership (bool owe);
70  bool get_ownership (void) const;
71  ~doc_impl (void);
72 
73  xmlDocPtr doc_;
74  xsltStylesheetPtr xslt_stylesheet_;
75 
76  // Note: the root_ member is required only for the document::get_root_node()
77  // member. The root_ member never owes the node it points to. The
78  // owner of the node is always a document!
79  // When a document is created, both the xmlDoc and xmlNode (for the
80  // root node) structures are created.
81  // The root_ member is set at the time when get_root_node() is
82  // called.
85 
86  // Note: the value of the member is in sync with what is in the
87  // doc_->encoding most of the time except one case. When a read document does
88  // not have an encoding spec and then doc.get_encoding() is called then:
89  // - the encoding_ member will be updated with a default "ISO-8859-1"
90  // - the doc->encoding will preserve the NULL value
91  // It seems OK as the serialization results with both values look the same.
93 
96  bool owe_;
97 };
98 
99 } // namespace impl
100 } // namespace xml
101 
102 #endif
103 
The xml::dtd class represents an XML dtd from a file.
Definition: dtd.hpp:62
The xml::node class is used to hold information about one XML node.
Definition: node.hpp:106
XML dtd API for XmlWrapp.
string
Definition: cgiapp.hpp:687
yy_size_t n
This file contains the definition of the xml::node class.
XML library namespace.
Definition: attributes.hpp:57
This file contains the definition of the xml::node manipulation functions.
void set_ownership(bool owe)
bool get_ownership(void) const
void set_root_node(const node &n)
xsltStylesheetPtr xslt_stylesheet_
void set_doc_data(xmlDocPtr newdoc, bool root_is_okay)
Modified on Wed May 29 18:35:20 2024 by modify_doxy.py rev. 669887