// Copyright (C) 2006 Erik Dahlberg
//
-// This file is part of LSystem3d.
+// This file is part of LSystem3D.
//
// LSystem3D is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
#include <string>
+#include <libxml++/attribute.h>
#include <libxml++/document.h>
#include <libxml++/nodes/element.h>
#include <libxml++/nodes/node.h>
_rootElement = NULL;
_activeElement = NULL;
_activeDocument = NULL;
- _activeChildInList = NULL;
+ _activeChildInList = (xmlpp::Node::NodeList::iterator)NULL;
}
xmlpp::Element *child = dynamic_cast<xmlpp::Element*>(*_activeChildInList);
// its attribute value
- string attributeValue = child->get_attribute(name)->get_value();
+ string attributeValue;
+ xmlpp::Attribute *attribute = child->get_attribute(name);
+
+ if (attribute)
+ {
+ attributeValue = attribute->get_value();
+ }
return attributeValue;
}