Commit a4f4efbb authored by Jerry Clarke's avatar Jerry Clarke
Browse files

Allow for Root Element Name Other than Xdmf

parent 24a721ed
......@@ -323,7 +323,7 @@ return(XDMF_SUCCESS);
}
XdmfXmlNode
XdmfDOM::Create(XdmfConstString Version){
XdmfDOM::Create(XdmfConstString RootElementName, XdmfConstString Version){
XdmfInt32 Status;
ostrstream XmlString;
const xmlChar *XmlNs = XINCLUDE_NS;
......@@ -332,7 +332,7 @@ XdmfDOM::Create(XdmfConstString Version){
Version = XDMF_VERSION_STRING;
}
XmlString << "<?xml version=\"1.0\" ?>";
XmlString << "<Xdmf Version=\"" << Version << "\" xmlns:xi=\"" << XmlNs << "\" />" << ends;
XmlString << "<" << RootElementName << " Version=\"" << Version << "\" xmlns:xi=\"" << XmlNs << "\" />" << ends;
Status = this->Parse(XmlString.str());
if(Status == XDMF_FAIL) return(NULL);
return(this->GetRoot());
......
......@@ -163,7 +163,7 @@ public :
//! Create a node from an XML string and insert it in the DOM
XdmfXmlNode InsertFromString(XdmfXmlNode parent, XdmfConstString xml );
//! Create a new document
XdmfXmlNode Create(XdmfConstString Version="2.0");
XdmfXmlNode Create(XdmfConstString RootElementName="Xdmf", XdmfConstString Version="2.0");
//! Create a new node under an existing one
XdmfXmlNode InsertNew(XdmfXmlNode Parent, XdmfConstString Type);
//! Delete a node
......
......@@ -68,7 +68,7 @@ XdmfInt32 XdmfRoot::Build(){
if(this->GetDOM()){
XdmfXmlNode node;
node = this->GetDOM()->Create();
node = this->GetDOM()->Create(this->GetElementName());
this->SetElement(node);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment