Sha256: 7a69c6beb0a5171fda3d02718bbf6010cb92eabe3f07dc7e720d6296f81ffcf5

Contents?: true

Size: 942 Bytes

Versions: 54

Compression:

Stored size: 942 Bytes

Contents

XML Node
==========


Example for generating xml:
  
  # Create an atom like document
  
  root = XmlNode.new 'feed' do |feed|
    
    feed << XmlNode.new('id', 'tag:atom.com,2007:1')
    feed << XmlNode.new('title', 'Atom test feed')
    feed << XmlNode.new('author') do |author|
      author << XmlNode.new("name", "tobi")
      author << XmlNode.new("email", "tobi@gmail.com")
    end
    
    feed << XmlNode.new('entry') do |entry|
      entry << XmlNode.new('title', 'First post')
      entry << XmlNode.new('summary', 'Lorem ipsum', :type => 'xhtml')
      entry << XmlNode.new('created_at', Time.now)
    end
    
    feed << XmlNode.new('dc:published', Time.now)
  end
  
  root.to_xml #=> Well formatted xml
  
  
Example for parsing xml:


  xml = XmlNode.parse('<feed attr="1"><element>text</element><element>text</element></feed>')
  xml['attr'] #=> '1'
  xml.children['element'].text #=> 'text'
  xml.children.each { |e| e... }

Version data entries

54 entries across 54 versions & 6 rubygems

Version Path
omniship-0.4.7 lib/vendor/xml_node/README
active_shipping-0.12.6 lib/vendor/xml_node/README
omniship-0.4.6 lib/vendor/xml_node/README
omniship-0.4.5 lib/vendor/xml_node/README
omniship-0.4.1 lib/vendor/xml_node/README
active_shipping-1.0.0.pre4 lib/vendor/xml_node/README
active_shipping-1.0.0.pre3 lib/vendor/xml_node/README
active_shipping-1.0.0.pre2 lib/vendor/xml_node/README
active_shipping-1.0.0.pre1 lib/vendor/xml_node/README
active_shipping-0.12.5 lib/vendor/xml_node/README
bcarpenter-active_shipping-0.0.2 lib/vendor/xml_node/README
bcarpenter-active_shipping-0.0.5 lib/vendor/xml_node/README
bcarpenter-active_shipping-0.0.6 lib/vendor/xml_node/README
bcarpenter-active_shipping-0.0.7 lib/vendor/xml_node/README
active_shipping-0.12.4 lib/vendor/xml_node/README
active_shipping-0.12.3 lib/vendor/xml_node/README
active_shipping-0.12.2 lib/vendor/xml_node/README
active_shipping-0.12.1 lib/vendor/xml_node/README
active_shipping-0.12.0 lib/vendor/xml_node/README
omniship-0.4.0 lib/vendor/xml_node/README