summaryrefslogtreecommitdiff
path: root/src/xml.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-09-09 18:12:32 +0100
committerCarl Hetherington <cth@carlh.net>2012-09-09 18:12:32 +0100
commit8411002d2c768dfaaa4b89cf6a2b12b3967f1f69 (patch)
tree35f43d5f12ca34868c7b64de1671ca72b38177b1 /src/xml.cc
parentc1798d06bb87eddfb08945893b0b9166fd097f93 (diff)
Clean up and fix subtitle parsing a bit.
Diffstat (limited to 'src/xml.cc')
-rw-r--r--src/xml.cc21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/xml.cc b/src/xml.cc
index 7ca3cc1a..4982e9fb 100644
--- a/src/xml.cc
+++ b/src/xml.cc
@@ -226,22 +226,17 @@ XMLNode::done ()
string
XMLNode::content ()
{
+ string content;
+
xmlpp::Node::NodeList c = _node->get_children ();
-
- if (c.size() > 1) {
- throw XMLError ("unexpected content in XML node");
+ for (xmlpp::Node::NodeList::const_iterator i = c.begin(); i != c.end(); ++i) {
+ xmlpp::ContentNode const * v = dynamic_cast<xmlpp::ContentNode const *> (*i);
+ if (v) {
+ content += v->get_content ();
+ }
}
- if (c.empty ()) {
- return "";
- }
-
- xmlpp::ContentNode const * v = dynamic_cast<xmlpp::ContentNode const *> (c.front());
- if (!v) {
- throw XMLError ("missing content in XML node");
- }
-
- return v->get_content ();
+ return content;
}
XMLFile::XMLFile (string file, string root_name)