aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/sst_from_xml.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2008-02-24 21:05:47 +0000
committerRalph Amissah <ralph@amissah.com>2008-02-24 21:05:47 +0000
commitec9282e23d3262a2746f9837e0bc57e9aa7a48d5 (patch)
treef1fdab5e27bad144a1e2472a8242348a45d03914 /lib/sisu/v0/sst_from_xml.rb
parentmake possible to strip 0.66 markup in dal commit (diff)
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
Diffstat (limited to 'lib/sisu/v0/sst_from_xml.rb')
-rw-r--r--lib/sisu/v0/sst_from_xml.rb7
1 files changed, 6 insertions, 1 deletions
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>(.+?)<\/i>/,'/{\1}/')
text.gsub!(/<b>(.+?)<\/b>/,'*{\1}*')
text.gsub!(/<u>(.+?)<\/u>/,'_{\1}_')
+ text.gsub!(/<sem:([a-z_]+)\s+depth=['"]zero['"]>(\s*.+?\s*)<\/sem:\1>/,';{ \2 };\1')
+ text.gsub!(/<sem:([a-z_]+)\s+depth=['"]one['"]>(\s*.+?\s*)<\/sem:\1>/,':{ \2 }:\1')
+ text.gsub!(/<sem:([a-z_]+)\s+depth=['"]many['"]>(\s*.+?\s*)<\/sem:\1>/,'\1:{ \2 }:\1')
+ text.gsub!(/<sem:([a-z_]+)>(\s*.+?\s*)<\/sem:\1>/,'\1:{ \2 }:\1')
text.gsub!(/\s +/,' ')
text.strip!
#text.gsub!(/<header>(.+?)<\/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?