14 #include <QStringList> 26 QStringList pathList = path.split(
"/");
27 QDomElement current = mNode.toElement();
32 for (
int i = 0; i < pathList.size(); ++i)
34 QDomElement next = current.namedItem(pathList[i]).toElement();
38 next = mNode.ownerDocument().createElement(pathList[i]);
39 current.appendChild(next);
56 element.appendChild(this->document().createTextNode(text));
62 QDomElement element = this->document().createElement(name);
63 mNode.appendChild(element);
67 QDomDocument XMLNodeAdder::document()
69 return mNode.ownerDocument();
82 QStringList pathList = path.split(
"/");
83 QDomElement current = mNode.toElement();
88 for (
int i = 0; i < pathList.size(); ++i)
90 QDomElement next = current.namedItem(pathList[i]).toElement();
103 return mNode.namedItem(name).toElement().text();
108 QString text = mNode.namedItem(name).toElement().text();
110 double val = text.toDouble(&ok);
119 for (QDomElement elem = mNode.firstChildElement(name);
121 elem = elem.nextSiblingElement(name))
123 retval << elem.text();
130 std::vector<QDomElement> retval;
131 for (QDomElement elem = mNode.firstChildElement(name);
133 elem = elem.nextSiblingElement(name))
135 retval.push_back(elem);
143 return mNode.namedItem(name).toElement();
double parseDoubleFromElementWithDefault(QString name, double defaultValue)
QStringList parseTextFromDuplicateElements(QString name)
XMLNodeAdder descend(QString path)
QDomElement addElement(QString name)
XMLNodeAdder(QDomNode node)
std::vector< QDomElement > getDuplicateElements(QString name)
QDomElement addTextToElement(QString name, QString text)
XMLNodeParser descend(QString path)
QString parseTextFromElement(QString name)
XMLNodeParser(QDomNode node)
QDomElement parseElement(QString name)
Namespace for all CustusX production code.