60 SGPath path(SGPath::fromUtf8(fname.c_str()));
62 if (path.isRelative())
63 path = model->FindFullPathName(path);
65 if (CachedFiles.find(path.utf8Str()) != CachedFiles.end())
66 document = CachedFiles[path.utf8Str()];
71 <<
"Could not open file: " << fname << endl;
74 CachedFiles[path.utf8Str()] = document;
77 if (document->GetName() != el->
GetName()) {
78 document->SetParent(el);
87 SGPath fullName = path/filename.utf8Str();
89 if (fullName.extension() !=
"xml")
90 fullName.concat(
".xml");
92 return fullName.exists() ? fullName : SGPath();
const std::string & GetName(void) const
Retrieves the element name.
std::string ReadFrom(void) const
Return a string that contains a description of the location where the current XML element was read fr...
void AddChildElement(Element *el)
Adds a child element to the list of children stored for this element.
std::string GetAttributeValue(const std::string &key)
Retrieves an attribute.
Element_ptr Open(Element *el)
Element * LoadXMLDocument(const SGPath &XML_filename, bool verbose=true)
SGPath CheckPathName(const SGPath &path, const SGPath &filename)
SGSharedPtr< Element > Element_ptr