diff options
author | Hans Baier <hansfbaier@googlemail.com> | 2008-05-23 10:36:51 +0000 |
---|---|---|
committer | Hans Baier <hansfbaier@googlemail.com> | 2008-05-23 10:36:51 +0000 |
commit | 4aa9d17ab1bc4b344bfb30aabf9a479e80f2d7e8 (patch) | |
tree | e4d277aae394e967f5c082db8f9dc0f9a36aaeae /libs/pbd/xml++.cc | |
parent | 5e856e94ac677a212920d1513966f97cc244eea1 (diff) |
* added midnam test file for xpath
* added to_string() to MIDI::Event
* added XMLNode::attribute_value for attribute nodes
* debugging output in MidiModel (incorrect rendering of Pitchbender events: Notes lost
* added xpath tests for midnam files
git-svn-id: svn://localhost/ardour2/branches/3.0@3406 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/xml++.cc')
-rw-r--r-- | libs/pbd/xml++.cc | 12 |
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; } + |