mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 11:14:00 +00:00
Fix incompatibilities with REXML 3.1.7
This commit is contained in:
parent
1da7def8bf
commit
d78ceb8258
|
@ -299,6 +299,7 @@ class MusicXMLListener
|
|||
#
|
||||
# Interesting text nodes have @kind set
|
||||
#
|
||||
@text.strip!
|
||||
if @kind
|
||||
case @kind
|
||||
when 'textProp'
|
||||
|
|
|
@ -434,13 +434,22 @@ def _score
|
|||
return score
|
||||
end
|
||||
|
||||
NEW_REXML = REXML::VERSION > "3.1.7"
|
||||
|
||||
xml = REXML::Document.new
|
||||
xml.add REXML::XMLDecl.new('1.0', 'UTF-8')
|
||||
xml.add REXML::DocType.new(['score-partwise', 'PUBLIC',
|
||||
'"-//Recordare//DTD MusicXML 1.1 Partwise//EN"',
|
||||
NEW_REXML ? 'http://www.musicxml.org/dtds/partwise.dtd' :
|
||||
'"http://www.musicxml.org/dtds/partwise.dtd"'])
|
||||
xml.add_element(_score)
|
||||
if NEW_REXML
|
||||
formatter = REXML::Formatters::Pretty.new(2)
|
||||
formatter.compact = true
|
||||
formatter.write(xml, $stdout)
|
||||
else
|
||||
xml.write($stdout, 0)
|
||||
end
|
||||
|
||||
# Local Variables:
|
||||
# mode:ruby
|
||||
|
|
Loading…
Reference in New Issue
Block a user