64{
65 if (!document) {
66 document = new Element(name);
67 current_element = document;
68 } else {
69 dumpDataLines();
70
71 Element* temp_element = new Element(name);
72 if (temp_element) {
73 temp_element->SetParent(current_element);
75 }
76 current_element = temp_element;
77 }
78
79 if (!current_element) {
80 LogException err;
81 err << "In file " << getPath() << ": line " << getLine() << "\n"
82 << "No current element read (running out of memory?)\n";
83 throw err;
84 }
85
88
89 for (int i=0; i<atts.size();i++) {
90 current_element->
AddAttribute(atts.getName(i), atts.getValue(i));
91 }
92}
void SetFileName(const std::string &name)
Set the name of the file in which the element has been read.
void AddAttribute(const std::string &name, const std::string &value)
Stores an attribute belonging to this element.
void SetLineNumber(int line)
Set the line number at which the element has been read.
void AddChildElement(Element *el)
Adds a child element to the list of children stored for this element.