This is a temporary place-holder site, and is an active work in progress.
-Lalee
2016 January
  • Mobile Applications

    Software development services for Android, iOS (iPhone and iPad), and Blackberry now available. Unleash your device's full business potential -- including GPS, Photos, and Multimedia -- when you develop your App with us!

    • Time and Attendance
    • Agile Routing and Scheduling
  • Web Applications

    All new websites created by Lalee Consulting are developed with the best-of-breed technologies.  With a special emphasis on Ruby on Rails and supporting technologies, you can be assured the solutions we deliver are fully-tested, high quality, and production-ready at product launch.

    Windows Server users, have no fear!  Our founder and lead developer is a Microsoft Certified Enterprise Applications Developer, which means we know all of the design issues involved to ensure all of the Awesome-Goodness we create will run flawlessly on your Windows Servers, too! (download pdf transcript)

  • Remote Support

    Do you have an "old faithful" website running on an aging server?  Does it need software updates or some other Server Administrator attention? Is your last System Administrator no longer available?  We can help!

    No matter where your server assets are hosted -- on Amazon, SliceHost, Linode, or your own corporate Internet-Connection -- as long as there's a usable Management Connection available, we can remotely administer that machine and perform any needed fixes to simply get your site up and running again.  We also provide server assessments to help you plan for the long-term to either bring your aging server back into proper health, or to migrate your assets onto a new server with minimal downtime involved.

    Does your application crash after everyone else has gone home for the night? Ask us about our Remote Server Monitoring and Management Services, and let us show you how we can either prevent those crashes, or respond to them in a minimum amount of time.

Code Highlighting Test

# encoding: UTF-8
# XSD4R - OXParser XML parser library.
# Copyright (C) 2015 Laurence A. Lee <rubyjedi@gmail.com>.

# This program is copyrighted free software by Laurence A. Lee.  You can
# redistribute it and/or modify it under the same terms of Ruby's license;
# either the dual license version in 2003, or any later version.

require 'ox'

module XSD
module XMLParser

class OxParser < XSD::XMLParser::Parser
  def do_parse(string_or_readable)
    $stderr.puts "XSD::XMLParser::OxParser.do_parse" if $DEBUG
    begin
      require 'htmlentities' # Used to unescape html-escaped chars, if available
      @decoder = ::HTMLEntities.new(:expanded)
    rescue LoadError
      @decoder = nil
    end
    handler = OxDocHandler.new(self, @decoder)

    string = string_or_readable.respond_to?(:read) ? string_or_readable.read : StringIO.new(string_or_readable)
    if @decoder.nil?
      # Use the built-in conversion with Ox.
      ::Ox.sax_parse(handler, string, {:symbolize=> false, :convert_special=> true, :skip=> :skip_return} )
    else
      # Use HTMLEntities Decoder.  Leave the special-character conversion alone and let HTMLEntities decode it for us.
      ::Ox.sax_parse(handler, string, {})
    end
  end
  
  public :start_element
  public :end_element
  public :characters
  public :xmldecl_encoding=

  add_factory(self)
end

class OxDocHandler
  
  def initialize(owner, decoder)
    @owner = owner
    @decoder = decoder
    reset_for_next_element
  end
  
  def attr(key, val)
    @attr_hash[key.to_s]=val
  end
  
  def attrs_done
    unless @element_name.nil?
      @owner.start_element(@element_name, @attr_hash) 
      reset_for_next_element
    end
  end
  
  def start_element(name)
    @element_name = name.to_s
  end
  
  def end_element(name)
    name = name.to_s
    @owner.end_element(name) unless @element_name.nil?
  end

  def text(t)
    @decoder.nil? ? @owner.characters(t) : @owner.characters(@decoder.decode(t))
  end
  
  alias_method :cdata, :text


  def instruct(n)
    # Set @element_name to nil so DocHandler does nothing with attrs or element name. This is the outer "XML" tag.
    @element_name = nil
  end

  def end_instruct(n)
    @owner.xmldecl_encoding= @attr_hash['encoding']
    reset_for_next_element
  end

  private
  
  def reset_for_next_element
    @attr_hash = {}
    @element_name = ""
  end  
end

end
end