* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
- *
- * $Id$
*/
+#include <string.h>
+
#include "xml.h"
#include <libxml/parser.h>
* public functions
*/
xml_t public;
-
+
/**
* root node of this xml (part)
*/
xmlNode *node;
-
+
/**
* document, only for root xml_t
*/
xmlDoc *doc;
-
+
/**
* Root xml_t*
*/
private_xml_t *root;
-
+
/**
* number of enumerator instances
*/
if (e->node)
{
xmlNode *text;
-
+
text = e->node->children;
*value = NULL;
-
+
while (text && text->type != XML_TEXT_NODE)
{
text = text->next;
}
/**
- * destroy enumerator, and complete tree if this was the last enumerator
+ * destroy enumerator, and complete tree if this was the last enumerator
*/
static void child_destroy(child_enum_t *this)
{
xml_t *xml_create(char *xml)
{
private_xml_t *this = malloc_thing(private_xml_t);
-
+
this->public.get_attribute = (char*(*)(xml_t*,char*))get_attribute;
this->public.children = (enumerator_t*(*)(xml_t*))children;
-
+
this->doc = xmlReadMemory(xml, strlen(xml), NULL, NULL, 0);
if (this->doc == NULL)
{
this->node = xmlDocGetRootElement(this->doc);
this->root = this;
this->enums = 0;
-
+
return &this->public;
}