lib/schematron-nokogiri.rb in schematron-nokogiri-0.0.2 vs lib/schematron-nokogiri.rb in schematron-nokogiri-0.0.3
- old
+ new
@@ -73,12 +73,12 @@
).first
hit.xpath('svrl:text/text()', NS_PREFIXES).each do |message|
results << {
:rule_type => rule_type,
- :type => node_type(context),
- :name => context.name,
- :line => context.line,
+ :type => context ? node_type(context) : nil,
+ :name => context ? context.name : nil,
+ :line => context ? context.line : nil,
:message => message.content.strip}
end
end
results