From 74266216596cd9e730f9ce40805d796e3331e22a Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Sat, 15 Nov 2008 19:42:19 +0100 Subject: [PATCH] MusicXML: Handle multiple elements --- .../musicxml/05b-MultipleRights.xml | 32 +++++++++++++++++++ python/musicxml.py | 10 +++--- 2 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 input/regression/musicxml/05b-MultipleRights.xml diff --git a/input/regression/musicxml/05b-MultipleRights.xml b/input/regression/musicxml/05b-MultipleRights.xml new file mode 100644 index 0000000000..40102cd09b --- /dev/null +++ b/input/regression/musicxml/05b-MultipleRights.xml @@ -0,0 +1,32 @@ + + + + + Copyright © XXXX by Y. ZZZZ. + Released To The Public Domain. + + There can be multiple + <rights> tags in the identification element of the score. The + conversion shall still work, ideally using both of + them. + + + + + MusicXML Part + + + + + + + 4 + 1 + whole + + + light-heavy + + + + diff --git a/python/musicxml.py b/python/musicxml.py index d2af5d5f2e..c6de611b9b 100644 --- a/python/musicxml.py +++ b/python/musicxml.py @@ -143,11 +143,11 @@ class Work (Xml_node): class Identification (Xml_node): def get_rights (self): - rights = self.get_maybe_exist_named_child ('rights') - if rights: - return rights.get_text () - else: - return '' + rights = self.get_named_children ('rights') + ret = [] + for r in rights: + ret.append (r.get_text ()) + return string.join (ret, "\n") def get_creator (self, type): creators = self.get_named_children ('creator') -- 2.39.5