diff options
Diffstat (limited to 'lib/sisu/v3dv/xml_dom.rb')
-rw-r--r-- | lib/sisu/v3dv/xml_dom.rb | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/lib/sisu/v3dv/xml_dom.rb b/lib/sisu/v3dv/xml_dom.rb index dd4dcd44..ae45100d 100644 --- a/lib/sisu/v3dv/xml_dom.rb +++ b/lib/sisu/v3dv/xml_dom.rb @@ -130,12 +130,12 @@ module SiSU_XML_DOM end protected def xml_markup(dob='') - dob.obj.gsub!(/#{Mx[:en_a_o]}(\d+)\s+(.+?)#{Mx[:en_a_c]}/, - '<endnote><number>\1</number><note>\2</note></endnote> ') - dob.obj.gsub!(/#{Mx[:en_b_o]}([*+]\d+)\s+(.+?)#{Mx[:en_b_c]}/, - '<endnote><symbol>\1</symbol><note>\2</note></endnote> ') - dob.obj.gsub!(/#{Mx[:en_a_o]}([*+]+)\s+(.+?)#{Mx[:en_a_c]}/, - '<endnote><symbol>\1</symbol><note>\2</note></endnote> ') + dob.obj=dob.obj.gsub(/#{Mx[:en_a_o]}(\d+)\s+(.+?)#{Mx[:en_a_c]}/, + '<endnote><number>\1</number><note>\2</note></endnote> '). + gsub(/#{Mx[:en_b_o]}([*+]\d+)\s+(.+?)#{Mx[:en_b_c]}/, + '<endnote><symbol>\1</symbol><note>\2</note></endnote> '). + gsub(/#{Mx[:en_a_o]}([*+]+)\s+(.+?)#{Mx[:en_a_c]}/, + '<endnote><symbol>\1</symbol><note>\2</note></endnote> ') end def xml_head metadata=SiSU_Metadata::Summary.new(@md).xml_dom.metadata @@ -309,27 +309,24 @@ WOK end def block_structure(dob) dob=@trans.markup_block(dob) #decide check & FIX - dob.obj.gsub!(/#{Mx[:en_a_o]}(\d+)\s+(.+?)#{Mx[:en_a_c]}/m, - '<endnote><number>\1</number><note>\2</note></endnote> ') - dob.obj.strip! + dob.obj=dob.obj.gsub(/#{Mx[:en_a_o]}(\d+)\s+(.+?)#{Mx[:en_a_c]}/m, + '<endnote><number>\1</number><note>\2</note></endnote> ').strip dob end def group_structure(dob) dob=@trans.markup_group(dob) #decide check & FIX - dob.obj.gsub!(/#{Mx[:en_a_o]}(\d+)\s+(.+?)#{Mx[:en_a_c]}/m, - '<endnote><number>\1</number><note>\2</note></endnote> ') - dob.obj.strip! + dob.obj=dob.obj.gsub(/#{Mx[:en_a_o]}(\d+)\s+(.+?)#{Mx[:en_a_c]}/m, + '<endnote><number>\1</number><note>\2</note></endnote> ').strip dob end def poem_structure(dob) dob=@trans.markup_group(dob) #decide check & FIX - dob.obj.strip! + dob.obj=dob.obj.strip dob end def code_structure(dob) dob=@trans.markup_group(dob) #decide check & FIX - dob.obj.gsub!(/\s\s/,'  ') - dob.obj.strip! + dob.obj=dob.obj.gsub(/\s\s/,'  ').strip dob end def table_structure(dob) #tables @@ -450,7 +447,7 @@ WOK end else # end - dob.obj.gsub!(/#{Mx[:pa_o]}:\S+#{Mx[:pa_c]}/,'') if dob.obj + dob.obj=dob.obj.gsub(/#{Mx[:pa_o]}:\S+#{Mx[:pa_c]}/,'') if dob.obj end end @content_flag=true @@ -497,7 +494,7 @@ WOK content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata] content << @@xml[:owner_details] if @md.stmp =~/\w\w/ content << @@xml[:tail] << @@xml[:close] - content.flatten!.compact! + content=content.flatten.compact Output.new(content,@md).xml @@xml[:head],@@xml[:body],@@xml[:tail]=[],[],[] # check whether should be nil end @@ -512,7 +509,7 @@ WOK SiSU_Env::FileOp.new(@md).mkdir filename_xml=@file.write_file.xml_dom @data.each do |str| - str.gsub!(/#{Mx[:pa_o]}:\S+#{Mx[:pa_c]}/,'') + str=str.gsub(/#{Mx[:pa_o]}:\S+#{Mx[:pa_c]}/,'') filename_xml.puts str unless str.empty? end filename_xml.close |