=begin
* Name: SiSU
* Description: a framework for document structuring, publishing and search
* Author: Ralph Amissah
* Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2007 Ralph Amissah All Rights Reserved.
* License: GPL 3 or later:
SiSU, a framework for document structuring, publishing and search
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2007 Ralph Amissah
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see .
If you have Internet connection, the latest version of the GPL should be
available at these locations:
* SiSU uses:
* Standard SiSU markup syntax,
* Standard SiSU meta-markup syntax, and the
* Standard SiSU object citation numbering and system
* Hompages:
* Download:
* Ralph Amissah
** Description: common file for xml generation
=end
module SiSU_text_parts
class Split_text_object
require "#{SiSU_lib}/param"
require "#{SiSU_lib}/xml_format"
include SiSU_Viz
include SiSU_XML_format
@@alt_id_count=0
@@dp=nil
attr_reader :format,:text,:ocn,:lev_para_ocn
def initialize(md,para)
@md,@para=md,para
@format,@ocn='null','null'
#@format,@ocn=nil,nil
@dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
end
def lev_segname_para_ocn #using shared_txt instead, watch #% watch closely
if @para =~/^(\d~|<:.+?>).+?<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
if /^([1-6])~(\S+)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
@format,segname,@text,@ocn=$1,$2,$3,$4
@format="#@format~#{segname}" #
elsif /^([1-6]~)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
@format,@text,@ocn=$1,$2,$3
elsif /<:(.+?)>\s*(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
@format,@text,@ocn=$1,$2,$3
elsif /^([1-6])~(\S+)\s+(\S.+?)<~(0);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
@@alt_id_count+=1
@format,segname,@text,@ocn=$1,$2,$3,"x#{@@alt_id_count}"
@format="#@format~#{segname}" #
elsif /^([1-6]~)\s+(\S.+?)<~(0);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
@@alt_id_count+=1
@format,@text,@ocn=$1,$2,"x#{@@alt_id_count}"
elsif /^(?:<:i([1-9])>\s*_\*)\s+(.+?)<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
@format,@text,@ocn="_#{$1}\*",$2,$3,$4
elsif /^(_\*)\s+(.+?)<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
@format,@text,@ocn=$1,$2,$3
elsif /<:(i[1-9])>\s*(.+?)<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
@format,@text,@ocn=$1,$2,$3
end
else
if /(.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
@text,@ocn=$1,$2
end
if @para !~/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$|^$/ #added 2002w06
@text=/(.+?)/m.match(@para)[1]
end
if /^(\d)~\S*\s+(.+)/m.match(@para)
@format,@text=$1,$2
end
end
@lev_para_ocn=if @para =~/.+<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
SiSU_XML_format::Format_scroll.new(@md,@format,@text,@ocn)
else
SiSU_XML_format::Format_scroll.new(@md,@format,@text,"<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>")
end
self
end
def lev_segname_para
if @para =~/^(\d~|<:.+?>).+/
if /^([1-6])~(\S+)\s+(\S.+)/m.match(@para)
@format,segname,@text=$1,$2,$3
@format="#@format~#{segname}" #
elsif /^([1-6]~)\s+(\S.+)/m.match(@para)
@format,@text=$1,$2
elsif /<:(.+?)>\s*(\S.+?)/m.match(@para)
@format,@text=$1,$2
elsif /^([1-6])~(\S+)\s+(\S.+?)/m.match(@para)
@@alt_id_count+=1
@format,segname,@text=$1,$2,$3
@format="#@format~#{segname}" #
elsif /^([1-6]~)\s+(\S.+?)/m.match(@para)
@@alt_id_count+=1
@format,@text=$1,$2
end
else
if /(.+?)/m.match(@para)
@text=$1
end
if @para !~/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$|^$/ #added 2002w06
@text=/(.+?)/m.match(@para)[1]
end
if /^(\d)~\S*\s+(.+)/m.match(@para)
@format,@text=$1,$2
end
end
@lev_para_ocn=if @para =~/.+<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
SiSU_XML_format::Format_scroll.new(@md,@format,@text,@ocn)
else
SiSU_XML_format::Format_scroll.new(@md,@format,@text,"<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>")
end
self
end
end
end
module SiSU_XML_munge
class Trans
require "#{SiSU_lib}/defaults"
def initialize(md)
@sys=SiSU_Env::System_call.new
@dir=SiSU_Env::Info_env.new(md.fns)
@dp=SiSU_Env::Info_env.new.digest.pattern
@url_brace=SiSU_Viz::Skin.new.url_decoration
end
def char_enc #character encode
def utf8(para='')
if @sys.locale =~/utf-?8/i # instead ucs for utf8 #require 'iconv' ? Iñtërnâtiônàlizætiøn
#¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûü
#¢£¥§©ª«®°±²³µ¶¹º»¼½¾×÷
##para.gsub!(//, '')
##para.gsub!(//, '&;')
para.gsub!(/¢/, '¢') # '¢' # ¢
para.gsub!(/£/, '£') # '£' # £
para.gsub!(/¥/, '¥') # '¥' # ¥
para.gsub!(/§/, '§') # '§' # §
para.gsub!(/©/, '©') # '©' # ©
para.gsub!(/ª/, 'ª') # 'ª' # ª
para.gsub!(/«/, '«') # '«' # «
para.gsub!(/®/, '®') # '®' # ®
para.gsub!(/°/, '°') # '°' # °
para.gsub!(/±/, '±') # '±' # ±
para.gsub!(/²/, '²') # '²' # ²
para.gsub!(/³/, '³') # '³' # ³
para.gsub!(/µ/, 'µ') # 'µ' # µ
para.gsub!(/¶/, '¶') # '¶' # ¶
para.gsub!(/¹/, '¹') # '¹' # ¹
para.gsub!(/º/, 'º') # 'º' # º
para.gsub!(/»/, '»') # '»' # »
para.gsub!(/¼/, '¼') # '¼' # ¼
para.gsub!(/½/, '½') # '½' # ½
para.gsub!(/¾/, '¾') # '¾' # ¾
para.gsub!(/×/, '×') # '×' # ×
para.gsub!(/÷/, '÷') # '÷' # ÷
para.gsub!(/¿/, '¿') # '¿' # ¿
para.gsub!(/À/, 'À') # 'À' # À
para.gsub!(/Á/, 'Á') # 'Á' # Á
para.gsub!(/Â/, 'Â') # 'Â' # Â
para.gsub!(/Ã/, 'Ã') # 'Ã' # Ã
para.gsub!(/Ä/, 'Ä') # 'Ä' # Ä
para.gsub!(/Å/, 'Å') # 'Å' # Å
para.gsub!(/Æ/, 'Æ') # 'Æ' # Æ
para.gsub!(/Ç/, 'Ç') # 'Ç' # Ç
para.gsub!(/È/, 'È') # 'È' # È
para.gsub!(/É/, 'É') # 'É' # É
para.gsub!(/Ê/, 'Ê') # 'Ê' # Ê
para.gsub!(/Ë/, 'Ë') # 'Ë' # Ë
para.gsub!(/Ì/, 'Ì') # 'Ì' # Ì
para.gsub!(/Í/, 'Í') # 'Í' # Í
para.gsub!(/Î/, 'Î') # 'Î' # Î
para.gsub!(/Ï/, 'Ï') # 'Ï' # Ï
para.gsub!(/Ð/, 'Ð') # 'Ð' # Ð
para.gsub!(/Ñ/, 'Ñ') # 'Ñ' # Ñ
para.gsub!(/Ò/, 'Ò') # 'Ò' # Ò
para.gsub!(/Ó/, 'Ó') # 'Ó' # Ó
para.gsub!(/Ô/, 'Ô') # 'Ô' # Ô
para.gsub!(/Õ/, 'Õ') # 'Õ' # Õ
para.gsub!(/Ö/, 'Ö') # 'Ö' # Ö
para.gsub!(/Ø/, 'Ø') # 'Ø' # Ø
para.gsub!(/Ù/, 'Ù') # 'Ù' # Ù
para.gsub!(/Ú/, 'Ú') # 'Ú' # Ú
para.gsub!(/Û/, 'Û') # 'Û' # Û
para.gsub!(/Ü/, 'Ü') # 'Ü' # Ü
para.gsub!(/Ý/, 'Ý') # 'Ý' # Ý
para.gsub!(/Þ/, 'Þ') # 'Þ' # Þ
para.gsub!(/ß/, 'ß') # 'ß' # ß
para.gsub!(/à/, 'à') # 'à' # à
para.gsub!(/á/, 'á') # 'á' # á
para.gsub!(/â/, 'â') # 'â' # â
para.gsub!(/ã/, 'ã') # 'ã' # ã
para.gsub!(/ä/, 'ä') # 'ä' # ä
para.gsub!(/å/, 'å') # 'å' # å
para.gsub!(/æ/, 'æ') # 'æ' # æ
para.gsub!(/ç/, 'ç') # 'ç' # ç
para.gsub!(/è/, 'è') # 'è' # è
para.gsub!(/é/, 'é') # '´' # é
para.gsub!(/ê/, 'ê') # 'ˆ' # ê
para.gsub!(/ë/, 'ë') # 'ë' # ë
para.gsub!(/ì/, 'ì') # 'ì' # ì
para.gsub!(/í/, 'í') # '´' # í
para.gsub!(/î/, 'î') # 'î' # î
para.gsub!(/ï/, 'ï') # 'ï' # ï
para.gsub!(/ð/, 'ð') # 'ð' # ð
para.gsub!(/ñ/, 'ñ') # 'ñ' # ñ
para.gsub!(/ò/, 'ò') # 'ò' # ò
para.gsub!(/ó/, 'ó') # 'ó' # ó
para.gsub!(/ô/, 'ô') # 'ô' # ô
para.gsub!(/õ/, 'õ') # 'õ' # õ
para.gsub!(/ö/, 'ö') # 'ö' # ö
para.gsub!(/ø/, 'ø') # 'ø' # ø
para.gsub!(/ù/, 'ú') # 'ù' # ú
para.gsub!(/ú/, 'û') # 'ú' # û
para.gsub!(/û/, 'ü') # 'û' # ü
para.gsub!(/ü/, 'ý') # 'ü' # ý
para.gsub!(/þ/, 'þ') # 'þ' # þ
para.gsub!(/ÿ/, 'ÿ') # 'ÿ' # ÿ
end
end
def html(para='')
if @sys.locale =~/utf-?8/i # instead ucs for utf8 #require 'iconv' ? Iñtërnâtiônàlizætiøn
para.gsub!(/¢/, '¢') # ¢
para.gsub!(/£/, '£') # £
para.gsub!(/¥/, '¥') # ¥
para.gsub!(/§/, '§') # §
para.gsub!(/©/, '©') # ©
para.gsub!(/ª/, 'ª') # ª
para.gsub!(/«/, '«') # «
para.gsub!(/®/, '®') # ®
para.gsub!(/°/, '°') # °
para.gsub!(/±/, '±') # ±
para.gsub!(/²/, '²') # ²
para.gsub!(/³/, '³') # ³
para.gsub!(/µ/, 'µ') # µ
para.gsub!(/¶/, '¶') # ¶
para.gsub!(/¹/, '¹') # ¹
para.gsub!(/º/, 'º') # º
para.gsub!(/»/, '»') # »
para.gsub!(/¼/, '¼') # ¼
para.gsub!(/½/, '½') # ½
para.gsub!(/¾/, '¾') # ¾
para.gsub!(/×/, '×') # ×
para.gsub!(/÷/, '÷') # ÷
para.gsub!(/¿/, '¿') # ¿
para.gsub!(/À/, 'À') # À
para.gsub!(/Á/, 'Á') # Á
para.gsub!(/Â/, 'Â') # Â
para.gsub!(/Ã/, 'Ã') # Ã
para.gsub!(/Ä/, 'Ä') # Ä
para.gsub!(/Å/, 'Å') # Å
para.gsub!(/Æ/, 'Æ') # Æ
para.gsub!(/Ç/, 'Ç') # Ç
para.gsub!(/È/, 'È') # È
para.gsub!(/É/, 'É') # É
para.gsub!(/Ê/, 'Ê') # Ê
para.gsub!(/Ë/, 'Ë') # Ë
para.gsub!(/Ì/, 'Ì') # Ì
para.gsub!(/Í/, 'Í') # Í
para.gsub!(/Î/, 'Î') # Î
para.gsub!(/Ï/, 'Ï') # Ï
para.gsub!(/Ð/, 'Ð') # Ð
para.gsub!(/Ñ/, 'Ñ') # Ñ
para.gsub!(/Ò/, 'Ò') # Ò
para.gsub!(/Ó/, 'Ó') # Ó
para.gsub!(/Ô/, 'Ô') # Ô
para.gsub!(/Õ/, 'Õ') # Õ
para.gsub!(/Ö/, 'Ö') # Ö
para.gsub!(/Ø/, 'Ø') # Ø
para.gsub!(/Ù/, 'Ù') # Ù
para.gsub!(/Ú/, 'Ú') # Ú
para.gsub!(/Û/, 'Û') # Û
para.gsub!(/Ü/, 'Ü') # Ü
para.gsub!(/Ý/, 'Ý') # Ý
para.gsub!(/Þ/, 'Þ') # Þ
para.gsub!(/ß/, 'ß') # ß
para.gsub!(/à/, 'à') # à
para.gsub!(/á/, 'á') # á
para.gsub!(/â/, 'â') # â
para.gsub!(/ã/, 'ã') # ã
para.gsub!(/ä/, 'ä') # ä
para.gsub!(/å/, 'å') # å
para.gsub!(/æ/, 'æ') # æ
para.gsub!(/ç/, 'ç') # ç
para.gsub!(/è/, 'è') # è
para.gsub!(/é/, '´') # é
para.gsub!(/ê/, 'ˆ') # ê
para.gsub!(/ë/, 'ë') # ë
para.gsub!(/ì/, 'ì') # ì
para.gsub!(/í/, '´') # í
para.gsub!(/î/, 'î') # î
para.gsub!(/ï/, 'ï') # ï
para.gsub!(/ð/, 'ð') # ð
para.gsub!(/ñ/, 'ñ') # ñ
para.gsub!(/ò/, 'ò') # ò
para.gsub!(/ó/, 'ó') # ó
para.gsub!(/ô/, 'ô') # ô
para.gsub!(/õ/, 'õ') # õ
para.gsub!(/ö/, 'ö') # ö
para.gsub!(/ø/, 'ø') # ø
para.gsub!(/ù/, 'ù') # ú
para.gsub!(/ú/, 'ú') # û
para.gsub!(/û/, 'û') # ü
para.gsub!(/ü/, 'ü') # ý
para.gsub!(/þ/, 'þ') # þ
para.gsub!(/ÿ/, 'ÿ') # ÿ
end
end
self
end
def tidywords(wordlist)
wordlist.each do |x|
x.gsub!(/&/,'&') unless x =~/&\S+;/
end
end
def markup(para='')
#if para !~/^<:code>/
wordlist=para.scan(/\S+|\n/) #\n needed for tables, check though added 2005w17
para=tidywords(wordlist).join(' ').strip
#end
para.gsub!(/(^|\s+)<\s+/,'\1< '); para.gsub!(/\s+>(\s+|$)/,' >\1')
para.gsub!(/<:pb>\s*/,'')
para.gsub!(/<+[-~]#>+/,'')
para.gsub!(/<0;\w\d+;[um]\d+><#@dp:#@dp>/,'')
if para !~/^<:code>/
#embeds a red-bullet image -->
para.gsub!(/(?:^|[^_\\])\{\s*(\S+?\.(?:jpg|png|gif))\s+(\d+)x(\d+)(\s+[^}]+)?\}(https?:\/\/\S+)/,
%{[\\1] \\4})
para.gsub!(/(?:^|[^_\\])\{\s*(\S+?\.(?:jpg|png|gif))(\s+[^}]+)?\}(https?:\/\/\S+)/,
%{\\1})
para.gsub!(/(^|\s)\{([^}]+)\}(https?:\/\/[^"><]+?)([,.:;"><]?(?=\s|$))/,
'\1\2\4') #watch, compare html_tune
para.gsub!(/(^|\s)((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/,
%{\\1#{@url_brace.xml_open}\\2#{@url_brace.xml_close}\\3})
para.gsub!(/\b[_\\]((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,
'\1\2') #escaped urls not linked, deal with later
para.gsub!(/ /,' ')
#para.gsub!(/ /,' ') #clean
else
para.gsub!(/(^|[^}])_/m,'\1>') #code-block: angle brackets special characters
para.gsub!(/(^|[^}])_/m,'\1>')
para.gsub!(/ /,' ')
end
para
end
def markup_light(para='')
para.gsub!(/\/\{(.+?)\}\//,'\1')
para.gsub!(/[*!]\{(.+?)\}[*!]/,'\1')
para.gsub!(/_\{(.+?)\}_/,'\1')
para.gsub!(/-\{(.+?)\}-/,'\1')
para.gsub!(/
/,'
')
para.gsub!(/<:pb>\s*/,'')
para.gsub!(/<[-~]#>/,'')
para.gsub!(/(^|\s)&\s+/,'\1& ') #sort
para.gsub!(/&([^;]{1,5})/,'&\1') #sort, rough estimate, revisit #WATCH found in node not sax
para.gsub!(/(?:^|[^_\\])\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|file|ftp):\/\/\S+|image)/,
"#{@dir.url.images_local}\/\\1")
para.gsub!(/ /,' ')
#para.gsub!(/ /,' ') #clean
wordlist=para.scan(/\S+|\n/) #\n needed for tables, check though added 2005w17
para=tidywords(wordlist).join(' ').strip
para
end
def markup_fictionbook(para='')
para.gsub!(/~\{([\d*+]+).+?\}~/,'[\1]')
para.gsub!(/\/\{(.+?)\}\//,'\1')
para.gsub!(/[*!]\{(.+?)\}[*!]/,'\1')
para.gsub!(/_\{(.+?)\}_/,'\1')
para.gsub!(/-\{(.+?)\}-/,'\1')
para.gsub!(/
/,'
')
para.gsub!(/<:pb>\s*/,'')
para.gsub!(/<[-~]#>/,'')
#temporary -->
para.gsub!(/<:\S+?>/,'')
#<-- temporary
para.gsub!(/<[-~]#>/,'')
para.gsub!(/(^|\s)&\s+/,'\1& ') #sort
para.gsub!(/&([^;]{1,5})/,'&\1') #sort, rough estimate, revisit #WATCH found in node not sax
para.gsub!(/(?:^|[^_\\])\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|file|ftp):\/\/\S+|image)/,
"#{@dir.url.images_local}\/\\1")
para.gsub!(/ /,' ')
#para.gsub!(/ /,' ') #clean
wordlist=para.scan(/\S+|\n/) #\n needed for tables, check though added 2005w17
para=tidywords(wordlist).join(' ').strip
para
end
def markup_group(para='')
para.gsub!(/,'<'); para.gsub!(/>/,'>')
para.gsub!(/<:?br(?:\s+\/)?>/,'
')
para.gsub!(/<(link xmlns:xlink=".+?")>/,'<\1>')
para.gsub!(/<(\/link)>/,'<\1>')
para.gsub!(/<(\/?en)>/,'<\1>')
para
end
end
end
module SiSU_XML_tags #Format
require "#{SiSU_lib}/param"
include SiSU_Param
include SiSU_Viz
class RDF
def initialize(md='',seg_name=[],tracker=0)
@dc_title=@dc_subtitle=@dc_creator=@dc_subject=@dc_description=@dc_publisher=@dc_contributor=@dc_date=@dc_date_created=@dc_date_issued=@dc_date_available=@dc_date_valid=@dc_date_modified=@dc_type=@dc_format=@dc_identifier=@dc_source=@dc_language=@dc_relation=@dc_coverage=@dc_rights=@copyright=@owner=@keywords=''
#seg_name=%{#{@@seg_name[@@tracker]} - } if @@seg_name[@@tracker]
@md=md
@sfx,@pdf=@md.sfx,@md.pdf
@rdfurl=%{ rdf:about="http://www.jus.uio.no/lm/toc"\n}
if @md.dc_title # DublinCore 1 - title
@rdf_title=%{ dc.title="#{seg_name}#{@md.dc_title}"\n}
@dc_title=%{ \n}
end
if @md.dc_creator # DublinCore 2 - creator/author (author)
@rdf_creator=%{ dc.creator="#{@md.dc_creator}"\n}
content=meta_content_clean(@md.dc_creator)
@dc_creator=%{ \n}
end
if @md.dc_subject # DublinCore 3 - subject (us library of congress, eric or udc, or schema???)
@rdf_subject=%{ dc.subject="#{@md.dc_subject}"\n}
content=meta_content_clean(@md.dc_subject)
@dc_subject=%{ \n}
end
if @md.dc_description # DublinCore 4 - description
@rdf_description=%{ dc.description="#{@md.dc_description}"\n}
content=meta_content_clean(@md.dc_description)
@dc_description=%{ \n}
end
if @md.dc_publisher # DublinCore 5 - publisher (current copy published by)
@rdf_publisher=%{ dc.publisher="#{@md.dc_publisher}"\n}
content=meta_content_clean(@md.dc_publisher)
@dc_publisher=%{ \n}
end
if @md.dc_contributor # DublinCore 6 - contributor
@rdf_contributor=%{ dc.contributor="#{@md.dc_contributor}"\n}
content=meta_content_clean(@md.dc_contributor)
@dc_contributor=%{ \n}
end
if @md.dc_date # DublinCore 7 - date year-mm-dd
@rdf_date=%{ dc.date="#{@md.dc_date}"\n}
@dc_date=%{ \n}
end
if @md.dc_date_created # DublinCore 7 - date.created year-mm-dd
@rdf_date_created=%{ dc.date.created="#{@md.dc_date_created}"\n}
@dc_date_created=%{ \n}
end
if @md.dc_date_issued # DublinCore 7 - date.issued year-mm-dd
@rdf_date_issued=%{ dc.date.issued="#{@md.dc_date_issued}"\n}
@dc_date_issued=%{ \n}
end
if @md.dc_date_available # DublinCore 7 - date.available year-mm-dd
@rdf_date_available=%{ dc.date.available="#{@md.dc_date_available}"\n}
@dc_date_available=%{ \n}
end
if @md.dc_date_valid # DublinCore 7 - date.valid year-mm-dd
@rdf_date_valid=%{ dc.date.valid="#{@md.dc_date_valid}"\n}
@dc_date_valid=%{ \n}
end
if @md.dc_date_modified # DublinCore 7 - date.modified year-mm-dd
@rdf_date_modified=%{ dc.date.modified="#{@md.dc_date_modified}"\n}
@dc_date_modified=%{ \n}
end
if @md.dc_type # DublinCore 8 - type (genre eg. report, convention etc)
@rdf_type=%{ dc.type="#{@md.dc_type}"\n}
content=meta_content_clean(@md.dc_type)
@dc_type=%{ \n}
end
if @md.dc_format # DublinCore 9 - format (use your mime type)
@rdf_format=%{ dc.format="#{@md.dc_format}"\n}
content=meta_content_clean(@md.dc_format)
@dc_format=%{ \n}
end
if @md.dc_identifier # DublinCore 10 - identifier (your identifier, could use urn which is free)
@rdf_identifier=%{ dc.identifier="#{@md.dc_identifier}"\n}
content=meta_content_clean(@md.dc_identifier)
@dc_identifier=%{ \n}
end
if @md.dc_source # DublinCore 11 - source (document source)
@rdf_source=%{ dc.source="#{@md.dc_source}"\n}
content=meta_content_clean(@md.dc_source)
@dc_source=%{ \n}
end
if @md.dc_language \
and @md.dc_language[:name] # DublinCore 12 - language (English)
@rdf_language=%{ dc.language="#{@md.dc_language[:name]}"\n}
@dc_language=%{ \n}
end
if @md.language_original \
and @md.language_original[:name]
@rdf_language_original=%{ dc.language="#{@md.language_original[:name]}"\n}
@language_original=%{ \n}
end
if @md.dc_relation # DublinCore 13 - relation
@rdf_relation=%{ dc.relation="#{@md.dc_relation}"\n}
content=meta_content_clean(@md.dc_relation)
@dc_relation=%{ \n}
end
if @md.dc_coverage # DublinCore 14 - coverage
@rdf_coverage=%{ dc.coverage="#{@md.dc_coverage}"\n}
content=meta_content_clean(@md.dc_coverage)
@dc_coverage=%{ \n}
end
if @md.dc_rights # DublinCore 15 - rights
@rdf_rights=%{ dc.rights="#{@md.dc_rights}"\n}
content=meta_content_clean(@md.dc_rights)
@dc_rights=%{ \n}
end
content=meta_content_clean(@md.keywords)
@keywords=%{ \n} if @md.keywords
@vz=SiSU_Env::Get_init.instance.skin
end
def meta_content_clean(content='')
unless content.nil?
content.tr!('"',"'")
end
content
end
def rdftoc #tocHead #values strung together, because some empty, and resulting output (line breaks) is much better
#
#
#
#Dublin Core
#### XML only :-( KEEP
#<
# \n
#\n
#WOK
end
def rdfseg #segHead
rdftoc
end
def comment_xml(extra='')
generator="Generated by: #{@md.sisu_version[:project]} #{@md.sisu_version[:version]} of #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]})" if @md.sisu_version[:version]
lastdone="Last Generated on: #{Time.now}"
rubyv="Ruby version: #{@md.ruby_version}"
sc=if @md.sc_info
"Source file: #{@md.sc_filename} version: #{@md.sc_number} of: #{@md.sc_date}"
else ''
end
if extra.empty?
<
WOK
else
<
WOK
end
end
def comment_xml_sax
desc='SiSU XML, SAX type representation'
comment_xml(desc)
end
def comment_xml_node
desc='SiSU XML, Node type representation'
comment_xml(desc)
end
def comment_xml_dom
desc='SiSU XML, DOM type representation'
comment_xml(desc)
end
def metatag_html #values strung together, because some empty, and resulting output (line breaks) is much better
#{@vz.js_head}
<