diff --git a/lib/wasabi/parser.rb b/lib/wasabi/parser.rb index 497487d..5add77a 100644 --- a/lib/wasabi/parser.rb +++ b/lib/wasabi/parser.rb @@ -183,12 +183,7 @@ def process_type(namespace, type, name) element_name = inner.attribute('name').to_s @types[name][element_name] = { :type => inner.attribute('type').to_s } - [ :nillable, :minOccurs, :maxOccurs ].each do |attr| - if v = inner.attribute(attr.to_s) - @types[name][element_name][attr] = v.to_s - end - end - + parse_indicators(namespace,element_name,inner) @types[name][:order!] << element_name end @@ -196,6 +191,7 @@ def process_type(namespace, type, name) element_name = inner_element.attribute('name').to_s @types[name][element_name] = { :type => inner_element.attribute('type').to_s } + parse_indicators(namespace,element_name,inner_element) @types[name][:order!] << element_name end @@ -314,5 +310,17 @@ def sections @sections = sections end + + private + + # parse XSD indicators + def parse_indicators(name,element_name,inner_xml) + + [ :nillable, :minOccurs, :maxOccurs ].each do |attr| + if v = inner_xml.attribute(attr.to_s) + @types[name][element_name][attr] = v.to_s + end + end + end end end