class SiSU_SimpleXML_ModelSax::Convert::Tidy

Public Class Methods

new(md,dir) click to toggle source
# File lib/sisu/sst_to_s_xml_sax.rb, line 438
def initialize(md,dir)
  @md,@env=md,dir
  @prog=SiSU_Env::InfoProgram.new
end

Public Instance Methods

xml() click to toggle source
# File lib/sisu/sst_to_s_xml_sax.rb, line 442
def xml
  if @prog.tidy !=false #note values can be other than true
    if (@md.opt.act[:verbose_plus][:set]==:on \
    || @md.opt.act[:maintenance][:set]==:on)
      SiSU_Screen::Ansi.new(
        @md.opt.act[:color_state][:set],
        'invert',
        'Using XML Tidy',
        'check document structure'
      ).colorize unless @md.opt.act[:quiet][:set]==:on
      SiSU_Screen::Ansi.new(
        @md.opt.act[:color_state][:set],
        '',
        '',
        'check document structure'
      )
      tell.grey_open unless @md.opt.act[:quiet][:set]==:on
      tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
      tidy =SiSU_Env::SystemCall.new("#{Dir.pwd}/#{@md.fn[:sxs]}",tidyfile)
      tidy.well_formed?
      tell.p_off unless @md.opt.act[:quiet][:set]==:on
    end
  end
end