Class: Riddl::Handlers::XMLSchema

Inherits:
Implementation show all
Defined in:
lib/ruby/riddl/handlers/xmlschema.rb

Class Method Summary collapse

Class Method Details

.handle(what, hinfo) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/ruby/riddl/handlers/xmlschema.rb', line 4

def self::handle(what,hinfo)
  w = if what.class == Riddl::Parameter::Tempfile || what.class == File
    XML::Smart.open_unprotected(what)
  else  
    XML::Smart.string(what)
  end  
  w.validate_against(XML::Smart.string(hinfo)) rescue false
end