diff options
Diffstat (limited to 'src/lib/dkdm_wrapper.cc')
| -rw-r--r-- | src/lib/dkdm_wrapper.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/dkdm_wrapper.cc b/src/lib/dkdm_wrapper.cc index 016c77c3f..4c7838a8d 100644 --- a/src/lib/dkdm_wrapper.cc +++ b/src/lib/dkdm_wrapper.cc @@ -41,7 +41,11 @@ DKDMBase::read (cxml::ConstNodePtr node) if (node->name() == "DKDM") { return make_shared<DKDM>(dcp::EncryptedKDM(node->content())); } else if (node->name() == "DKDMGroup") { - auto group = make_shared<DKDMGroup>(node->string_attribute("Name")); + auto name = node->optional_string_attribute("Name"); + if (!name) { + name = node->string_attribute("name"); + } + auto group = make_shared<DKDMGroup>(*name); for (auto i: node->node_children()) { if (auto c = read(i)) { group->add (c); @@ -62,17 +66,17 @@ DKDM::name () const void -DKDM::as_xml (xmlpp::Element* node) const +DKDM::as_xml(xmlpp::Element* element) const { - node->add_child("DKDM")->add_child_text (_dkdm.as_xml ()); + cxml::add_text_child(element, "DKDM", _dkdm.as_xml()); } void -DKDMGroup::as_xml (xmlpp::Element* node) const +DKDMGroup::as_xml(xmlpp::Element* element) const { - auto f = node->add_child("DKDMGroup"); - f->set_attribute ("Name", _name); + auto f = cxml::add_child(element, "DKDMGroup"); + f->set_attribute("name", _name); for (auto i: _children) { i->as_xml (f); } |
