class Riddl::Utils::XSLOverlay

Public Instance Methods

response() click to toggle source
# File lib/ruby/riddl/utils/xsloverlay.rb, line 5
def response
  doc = if @p[0].value.class == String 
    XML::Smart::string(@p[0].value)
  elsif @p[0].value.respond_to?(:read)
    XML::Smart::string(@p[0].value.read)
  else
    nil
  end
  unless doc.nil?
    doc.root.add_before "?xml-stylesheet", "href='#{@a[0]}' type='text/xsl'"
    Riddl::Parameter::Complex.new("content",@p[0].mimetype,doc.to_s)
  end  
end