require "libxml"
xp = XML::Parser.new
xp.string = '
John Smith
Ola Nordmann
Langgt 23
4000 Stavanger
Norway
-
Empire Burlesque
Special Edition
1
10.90
-
Hide your heart
1
9.90
'
doc = xp.parse
schema = XML::Schema.from_string('
')
p schema
if doc.validate_schema(schema) { |message, error| puts "#{error ? 'error' : 'warning'} : #{message}" }
puts "validation passed"
else
puts "validation failed"
end