Make ContentVersion Id node optional. Improve error message slightly.
authorCarl Hetherington <cth@carlh.net>
Mon, 27 Aug 2012 11:47:17 +0000 (12:47 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 27 Aug 2012 11:47:17 +0000 (12:47 +0100)
src/cpl.cc
src/xml.cc

index 649d54b7aeb1c257e01df9c0a4fc7005296ddf37..80962f4fffca14e13d96de0160db1b8aa4e5744a 100644 (file)
@@ -50,7 +50,7 @@ CPL::CPL (string file)
 ContentVersion::ContentVersion (xmlpp::Node const * node)
        : XMLNode (node)
 {
-       id = string_node ("Id");
+       id = optional_string_node ("Id");
        label_text = string_node ("LabelText");
        done ();
 }
index 35c4fe1274de2ef8e8f0e0701d6a9091f2d9b805..7a2bee2e0385fc4e03e536e42deffc67285b12a5 100644 (file)
@@ -31,7 +31,7 @@ XMLNode::xml_node (string name)
        if (n.size() > 1) {
                throw XMLError ("duplicate XML tag " + name);
        } else if (n.empty ()) {
-               throw XMLError ("missing XML tag " + name);
+               throw XMLError ("missing XML tag " + name + " in " + _node->get_name());
        }
        
        return n.front ();