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