From: Reinhold Kainhofer Date: Sat, 15 Nov 2008 18:42:19 +0000 (+0100) Subject: MusicXML: Handle multiple elements X-Git-Tag: release/2.11.64-1~15 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=74266216596cd9e730f9ce40805d796e3331e22a;p=lilypond.git MusicXML: Handle multiple elements --- 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')