diff --git a/Filters/VLMusicXMLType.reader b/Filters/VLMusicXMLType.reader index 49f3e14..63cc4de 100755 --- a/Filters/VLMusicXMLType.reader +++ b/Filters/VLMusicXMLType.reader @@ -299,6 +299,7 @@ class MusicXMLListener # # Interesting text nodes have @kind set # + @text.strip! if @kind case @kind when 'textProp' diff --git a/Filters/VLMusicXMLType.writer b/Filters/VLMusicXMLType.writer index cc5e57d..834acd6 100755 --- a/Filters/VLMusicXMLType.writer +++ b/Filters/VLMusicXMLType.writer @@ -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"', - '"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.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: # mode:ruby