module Tiss::Generator

Public Instance Methods

models_from(xsd_definitions) click to toggle source
# File lib/tiss/generator/generator.rb, line 9
def models_from(xsd_definitions)
  doc = Nokogiri::XML xsd_definitions

  schema = doc.children.first

  raise 'Invalid XMLSchema root' if schema.name != 'schema'
  raise 'Missing XMLSchema namespace' if schema.namespace.nil?
  raise 'Wrong XMLSchema namespace' unless is_xml_schema_node schema

  schema.children.each { |node| make_definition node }
end