Class: RXSD::XSD::ComplexContent
- Inherits:
-
Object
- Object
- RXSD::XSD::ComplexContent
- Defined in:
- lib/rxsd/xsd/complex_content.rb
Overview
XSD ComplexContent defintion www.w3schools.com/Schema/el_complexcontent.asp
Instance Attribute Summary collapse
-
#extension ⇒ Object
complex content children.
-
#id ⇒ Object
complex content attributes.
-
#mixed ⇒ Object
complex content attributes.
-
#parent ⇒ Object
complex content parent.
-
#restriction ⇒ Object
complex content children.
Class Method Summary collapse
-
.from_xml(node) ⇒ Object
node passed in should be a xml node representing the group.
-
.tag_name ⇒ Object
xml tag name.
Instance Method Summary collapse
-
#child_attributes ⇒ Object
return all child attributes associated w/ complex content.
-
#children ⇒ Object
returns array of all children.
-
#info ⇒ Object
return xsd node info.
-
#resolve(node_objs) ⇒ Object
resolve hanging references given complete xsd node object array.
-
#to_class_builder(cb = nil) ⇒ Object
convert complex content to class builder.
Instance Attribute Details
#extension ⇒ Object
complex content children
17 18 19 |
# File 'lib/rxsd/xsd/complex_content.rb', line 17 def extension @extension end |
#id ⇒ Object
complex content attributes
14 15 16 |
# File 'lib/rxsd/xsd/complex_content.rb', line 14 def id @id end |
#mixed ⇒ Object
complex content attributes
14 15 16 |
# File 'lib/rxsd/xsd/complex_content.rb', line 14 def mixed @mixed end |
#parent ⇒ Object
complex content parent
20 21 22 |
# File 'lib/rxsd/xsd/complex_content.rb', line 20 def parent @parent end |
#restriction ⇒ Object
complex content children
17 18 19 |
# File 'lib/rxsd/xsd/complex_content.rb', line 17 def restriction @restriction end |
Class Method Details
.from_xml(node) ⇒ Object
node passed in should be a xml node representing the group
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/rxsd/xsd/complex_content.rb', line 41 def self.from_xml(node) complex_content = ComplexContent.new complex_content.parent = node.parent. node. = complex_content # TODO group attributes: | anyAttributes complex_content.id = node.attrs["id"] complex_content.mixed = node.attrs.has_key?("mixed") ? node.attrs["mixed"].to_b : false complex_content.restriction = node.child_obj Restriction complex_content.extension = node.child_obj Extension return complex_content end |
.tag_name ⇒ Object
xml tag name
23 24 25 |
# File 'lib/rxsd/xsd/complex_content.rb', line 23 def self.tag_name "complexContent" end |
Instance Method Details
#child_attributes ⇒ Object
return all child attributes associated w/ complex content
77 78 79 80 81 82 |
# File 'lib/rxsd/xsd/complex_content.rb', line 77 def child_attributes atts = [] atts += @restriction.child_attributes unless @restriction.nil? atts += @extension.child_attributes unless @extension.nil? return atts end |
#children ⇒ Object
returns array of all children
33 34 35 36 37 38 |
# File 'lib/rxsd/xsd/complex_content.rb', line 33 def children c = [] c.push @restriction unless @restriction.nil? c.push @extension unless @extension.nil? return c end |
#info ⇒ Object
return xsd node info
28 29 30 |
# File 'lib/rxsd/xsd/complex_content.rb', line 28 def info "complexContent id: #{@id}" end |
#resolve(node_objs) ⇒ Object
resolve hanging references given complete xsd node object array
57 58 |
# File 'lib/rxsd/xsd/complex_content.rb', line 57 def resolve(node_objs) end |
#to_class_builder(cb = nil) ⇒ Object
convert complex content to class builder
61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/rxsd/xsd/complex_content.rb', line 61 def to_class_builder(cb = nil) unless defined? @class_builder # dispatch to child restriction/extension @class_builder = cb if !@restriction.nil? @class_builder = @restriction.to_class_builder(@class_builder) elsif !@extension.nil? @class_builder = @extension.to_class_builder(@class_builder) end end return @class_builder end |