lib/junoser/xsd/element.rb in junoser-0.3.12 vs lib/junoser/xsd/element.rb in junoser-0.3.13
- old
+ new
@@ -14,13 +14,13 @@
def config
@config ||= children.map {|child|
case child.name
when 'complexType'
- Junoser::Xsd::ComplexType.new(child, depth: @depth+1)
+ Junoser::Xsd::ComplexType.new(child, depth: @depth+1, parent: self)
when 'simpleType'
- Junoser::Xsd::SimpleType.new(child, depth: @depth+1)
+ Junoser::Xsd::SimpleType.new(child, depth: @depth+1, parent: self)
else
raise "ERROR: unknown element: #{child.name}"
end
}
end
@@ -68,11 +68,11 @@
when @argument.is_a?(String)
@argument
when @argument.name == 'simpleType'
'arg'
else
- arg = Junoser::Xsd::Element.new(@argument, depth: @depth+1).config
+ arg = Junoser::Xsd::Element.new(@argument, depth: @depth+1, parent: self).config
raise "ERROR: argument shouldn't consist of multiple elements" if arg.size > 1
arg.first.to_s.strip
end
end
@@ -95,9 +95,13 @@
super(header, content, footer)
end
def documentation
@documentation ||= xml.xpath('./xsd:annotation/xsd:documentation').text
+
+ # Translate multiline documentation into a single line to make it parsable in further processes
+ @documentation.gsub! /\n\s*/, ' '
+
@documentation.empty? ? nil : @documentation
end
end
end
end