2 * LibAxl: Another XML library
3 * Copyright (C) 2006 Advanced Software Production Line, S.L.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation; either version 2.1 of
8 * the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program; if not, write to the Free
17 * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 * You may find a copy of the license under this software is released
21 * at COPYING file. This is LGPL software: you are welcome to
22 * develop proprietary applications using this library without any
23 * royalty or fee but returning back any change, improvement or
24 * addition in the form of source code, project image, documentation
27 * For commercial support on build XML enabled solutions contact us:
30 * Advanced Software Production Line, S.L.
31 * C/ Dr. Michavila NÂș 14
32 * Coslada 28820 Madrid
36 * info@aspl.es - http://fact.aspl.es
46 * \addtogroup axl_doc_module
50 axlDoc
* axl_doc_create (const char * version
,
51 const char * encoding
,
54 axlDoc
* axl_doc_parse (const char * entity
,
58 axlDoc
* axl_doc_parse_strings (axlError
** error
,
61 axlDoc
* axl_doc_parse_from_file (const char * file_path
,
64 bool axl_doc_dump (axlDoc
* doc
,
68 bool axl_doc_dump_pretty (axlDoc
* doc
,
73 bool axl_doc_dump_to_file (axlDoc
* doc
,
76 bool axl_doc_dump_pretty_to_file (axlDoc
* doc
,
80 int axl_doc_get_flat_size (axlDoc
* doc
);
82 bool axl_doc_are_equal (axlDoc
* doc
,
85 bool axl_doc_are_equal_trimmed (axlDoc
* doc
,
88 axlNode
* axl_doc_get_root (axlDoc
* doc
);
90 void axl_doc_set_root (axlDoc
* doc
,
93 axlList
* axl_doc_get_list (axlDoc
* doc
,
94 const char * path_to
);
96 axlNode
* axl_doc_get (axlDoc
* doc
,
97 const char * path_to
);
100 * @brief Convenience macro that allows to call \ref
101 * axl_node_find_called, providing a document, making the parent
102 * reference to use the root document node.
104 * See \ref axl_node_find_called for more information.
106 * @param doc The document where the node lookup will be produced.
107 * @param name The child node name that is looked up.
109 * @return A reference to the node found or NULL if it fails to find
110 * the node requested.
112 #define axl_doc_find_called(doc,name) (axl_node_find_called(axl_doc_get_root(doc),name))
114 const char * axl_doc_get_content_at (axlDoc
* doc
,
115 const char * path_to
,
118 const char * axl_doc_get_encoding (axlDoc
* doc
);
120 bool axl_doc_get_standalone (axlDoc
* doc
);
122 void axl_doc_free (axlDoc
* doc
);
124 void axl_doc_set_child_current_parent (axlDoc
* doc
,
127 void axl_doc_pop_current_parent (axlDoc
* doc
);
129 void axl_doc_add_pi_target (axlDoc
* doc
,
133 bool axl_doc_has_pi_target (axlDoc
* doc
,
136 char * axl_doc_get_pi_target_content (axlDoc
* doc
,
139 axlList
* axl_doc_get_pi_target_list (axlDoc
* doc
);
141 axlPI
* axl_pi_create (char * name
,
144 axlPI
* axl_pi_copy (axlPI
* pi
);
146 bool axl_pi_are_equal (axlPI
* pi
,
149 char * axl_pi_get_name (axlPI
* pi
);
151 char * axl_pi_get_content (axlPI
* pi
);
153 void axl_pi_free (axlPI
* pi
);
155 int axl_pi_get_size (axlPI
* pi
);
157 bool axl_doc_iterate (axlDoc
* doc
,
158 AxlIterationMode mode
,
159 axlIterationFunc func
,
162 bool axl_doc_iterate_full (axlDoc
* doc
,
163 AxlIterationMode mode
,
164 axlIterationFunc2 func
,
168 bool axl_doc_iterate_full_from (axlDoc
* doc
,
169 axlNode
* starting_from
,
170 AxlIterationMode mode
,
171 axlIterationFunc2 func
,
175 /* private API starts from here, do not use this API */
177 bool axl_doc_consume_comments (axlDoc
* doc
,
181 bool axl_doc_consume_pi (axlDoc
* doc
,
186 axlFactory
* axl_doc_get_item_factory (axlDoc
* doc
);