Search Wiki:
Project Description
A simple wrapper around System.Xml.XmlDocument allowing you to parse Xml documents from IronRuby. Great for use with REST APIs

Example
This can also be found on the downloads tab.

# Include the wrapper
require 'xml'
 
# Create the document
@document = Document.new('<root><name><first>Jim</first><dob><year>1933</year><month>12</month></dob></name><name><first>Bob</first><last>Smith</last></name></root>')
 
# Access root/name elements
@document.elements('root/name') do |e|
   # Output the contents of the element named first
   puts e.get('first')
   
   # Access the element named dob, then output the value of year.
   e.node('dob') {|y| puts y.get('year')}
end

Created by Ben Hall
Last edited Jan 2 at 4:21 AM  by BenHall, version 3
Comments
BenHall wrote  Jan 8 at 2:50 AM  
Blog Post on code - http://blog.benhall.me.uk/2009/01/parsing-xml-using-ironruby.html

Updating...
Page view tracker