# MIT License module Rack class XSLView def initialize(app, options) @my_path_info = String.new @app = app @myhash = {} @options = {:myxsl => nil}.merge(options) if @options[:myxsl] == nil @xslt = XML::XSLT.new() @xslt.xsl = REXML::Document.new '' else @xslt = @options[:myxsl] end end def call(env) if checknoxsl(env) @app.call(env) else if @options[:reload] == true puts @options[:filepath] @xslt = XML::XSLT.new() @xslt.xsl = REXML::Document.new @options[:xslfile] end unless @options[:passenv] == nil @options[:passenv].each { |envkey| if (mp = env[envkey]) @myhash[envkey] = "#{mp}" end } @xslt.parameters = @myhash end status, headers, body = @app.call(env) # Obtain entire request body parts = '' body.each { |part| parts << part.to_s } # TODO Refactor if ((parts.include? "