Class | Bio::PhyloXML::Other
In: | lib/bio/db/phyloxml/phyloxml_elements.rb
Parent: | Object

### Methods

new to_xml

### Attributes

attributes | [RW] |
children | [RW] |
element_name | [RW] |
value | [RW] |

### Public Class methods

new()

[Source]

          # File lib/bio/db/phyloxml/phyloxml_elements.rb, line 1151
    1151:       def initialize
    1152:         @children = []
    1153:         @attributes = Hash.new
    1154:       end

### Public Instance methods

to_xml()

Converts elements to xml representation. Called by PhyloXML::Writer class.

[Source]

          # File lib/bio/db/phyloxml/phyloxml_elements.rb, line 1157
    1157:       def to_xml
    1158:         o = LibXML::XML::Node.new(@element_name)
    1159:         @attributes.each do |key, value|
    1160:           o[key] = value
    1161:         end
    1162:         o << value if value != nil
    1163:         children.each do |child_node|
    1164:           o << child_node.to_xml
    1165:         end
    1166:         return o
    1167:       end

[Validate]