lib/sax-machine/sax_config.rb in astro-sax-machine-0.0.14 vs lib/sax-machine/sax_config.rb in astro-sax-machine-0.0.15
- old
+ new
@@ -27,14 +27,19 @@
element_config.name == name &&
element_config.has_value_and_attrs_match?(attrs)
end
end
- def element_config_for_tag(name, attrs)
+ def element_config_for_tag(name, attrs, nsstack)
+ prefix, name = name.split(':', 2)
+ prefix, name = nil, prefix unless name # No prefix
+ namespace = nsstack[prefix]
+
@top_level_elements.detect do |element_config|
element_config.name == name &&
+ element_config.xmlns_match?(namespace) &&
element_config.attrs_match?(attrs)
end
end
end
-end
\ No newline at end of file
+end