From ec9282e23d3262a2746f9837e0bc57e9aa7a48d5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 24 Feb 2008 21:05:47 +0000 Subject: enable conversion from sst to various forms of input xml and back including 0.66 tags sst_to_s_xml (sax/dom/node) semantic xml mockup naive conversion of known abbreviated tags, in flux, e.g. sisu --to-sax autonomy_markup0.sst back to sst markup with: sisu --from-sxml autonomy_markup0.sxs.xml sst_to_s_dom fix to footnote/endnote conversion --- lib/sisu/v0/sst_from_xml.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/sisu/v0/sst_from_xml.rb') diff --git a/lib/sisu/v0/sst_from_xml.rb b/lib/sisu/v0/sst_from_xml.rb index d93e68b8..af43e611 100644 --- a/lib/sisu/v0/sst_from_xml.rb +++ b/lib/sisu/v0/sst_from_xml.rb @@ -1,3 +1,4 @@ +# coding: utf-8 =begin * Name: SiSU @@ -99,6 +100,10 @@ module SiSU_sst_from_xml text.gsub!(/(.+?)<\/i>/,'/{\1}/') text.gsub!(/(.+?)<\/b>/,'*{\1}*') text.gsub!(/(.+?)<\/u>/,'_{\1}_') + text.gsub!(/(\s*.+?\s*)<\/sem:\1>/,';{ \2 };\1') + text.gsub!(/(\s*.+?\s*)<\/sem:\1>/,':{ \2 }:\1') + text.gsub!(/(\s*.+?\s*)<\/sem:\1>/,'\1:{ \2 }:\1') + text.gsub!(/(\s*.+?\s*)<\/sem:\1>/,'\1:{ \2 }:\1') text.gsub!(/\s +/,' ') text.strip! #text.gsub!(/
(.+?)<\/header/,"@#{x.name}: \\1\n\n") @@ -126,7 +131,7 @@ module SiSU_sst_from_xml sax end def dom - raise "#{__FILE}::#{__LINE__} xml dom representation to sst not yet implemented (experimental simple xml representations sax and node to sst are in place)." + raise "#{__FILE__}::#{__LINE__} xml dom representation to sst not yet implemented (experimental simple xml representations sax and node to sst are in place)." end def xml_to_sisu unless @opt.files.empty? -- cgit v1.2.3