summaryrefslogtreecommitdiff
path: root/libs/pbd/xml++.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pbd/xml++.cc')
-rw-r--r--libs/pbd/xml++.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc
index 8dff34c678..522b1dc3bc 100644
--- a/libs/pbd/xml++.cc
+++ b/libs/pbd/xml++.cc
@@ -301,6 +301,17 @@ XMLNode::find(const string xpath) const
return result;
}
+std::string
+XMLNode::attribute_value()
+{
+ XMLNodeList children = this->children();
+ assert(!_is_content);
+ assert(children.size() == 1);
+ XMLNode* child = *(children.begin());
+ assert(child->is_content());
+ return child->content();
+}
+
XMLNode *
XMLNode::add_content(const string & c)
{
@@ -537,3 +548,4 @@ static XMLSharedNodeList* find_impl(xmlXPathContext* ctxt, const string xpath)
return nodes;
}
+