--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 2.0 Partwise//EN"
+ "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise version="2.0">
+ <work>
+ <work-number></work-number>
+ <work-title></work-title>
+ </work>
+ <movement-number></movement-number>
+ <movement-title>Empty work-title, non-empty movement-title</movement-title>
+ <identification>
+ <miscellaneous>
+ <miscellaneous-field name="description">A piece with an empty (but
+ existing) work-title, but a non-empty movement-title. In this case
+ the movement-title should be chosen, even though the work-title
+ exists.</miscellaneous-field>
+ </miscellaneous>
+ </identification>
+ <part-list>
+ <score-part id="P1">
+ <part-name print-object="no">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>
+ </measure>
+ </part>
+ <!--=========================================================-->
+</score-partwise>
if value:
header.set_field (field, musicxml.escape_ly_output_string (value))
+ movement_title = tree.get_maybe_exist_named_child ('movement-title')
+ if movement_title:
+ set_if_exists ('title', movement_title.get_text ())
work = tree.get_maybe_exist_named_child ('work')
if work:
+ # Overwrite the title from movement-title with work->title
set_if_exists ('title', work.get_work_title ())
set_if_exists ('worknumber', work.get_work_number ())
set_if_exists ('opus', work.get_opus ())
- else:
- movement_title = tree.get_maybe_exist_named_child ('movement-title')
- if movement_title:
- set_if_exists ('title', movement_title.get_text ())
identifications = tree.get_named_children ('identification')
for ids in identifications: