]> git.donarmstrong.com Git - lilypond.git/commitdiff
MusicXML: Handle multiple <rights> elements
authorReinhold Kainhofer <reinhold@kainhofer.com>
Sat, 15 Nov 2008 18:42:19 +0000 (19:42 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Sat, 15 Nov 2008 22:28:16 +0000 (23:28 +0100)
input/regression/musicxml/05b-MultipleRights.xml [new file with mode: 0644]
python/musicxml.py

diff --git a/input/regression/musicxml/05b-MultipleRights.xml b/input/regression/musicxml/05b-MultipleRights.xml
new file mode 100644 (file)
index 0000000..40102cd
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone='no'?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise>
+  <identification>
+    <rights>Copyright © XXXX by Y. ZZZZ.</rights>
+    <rights>Released To The Public Domain.</rights>
+    <miscellaneous>
+      <miscellaneous-field name="description">There can be multiple 
+        &lt;rights&gt; tags in the identification element of the score. The 
+        conversion shall still work, ideally using both of 
+        them.</miscellaneous-field>
+    </miscellaneous>
+  </identification>
+  <part-list>
+    <score-part id="P1">
+      <part-name>MusicXML Part</part-name>
+    </score-part>
+  </part-list>
+  <part id="P1">
+    <measure number="1">
+      <note>
+        <rest/>
+        <duration>4</duration>
+        <voice>1</voice>
+        <type>whole</type>
+      </note>
+      <barline location="right">
+        <bar-style>light-heavy</bar-style>
+      </barline>
+    </measure>
+  </part>
+</score-partwise>
index d2af5d5f2e10717d236b4e8f7ad0a6f753e2b3ba..c6de611b9be8d812ba8673667f2ba17e001988a8 100644 (file)
@@ -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')