Method: XSD::XMLParser.filter_ns
- Defined in:
- lib/xsd/xmlparser.rb
.filter_ns(ns, attrs) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/xsd/xmlparser.rb', line 24 def filter_ns(ns, attrs) return attrs if attrs.nil? or attrs.empty? newattrs = {} attrs.each do |key, value| if (NSParseRegexp =~ key) # '' means 'default namespace'. tag = $1 || '' ns.assign(value, tag) else newattrs[key] = value end end newattrs end |