Direct from the libxml-ruby rdocs: ------------------ The libxml gem provides Ruby language bindings for GNOME’s Libxml2 XML toolkit. To get started you may:
require 'xml' document = XML::Document.new However, when creating an application or library you plan to redistribute, it is best to not add the LibXML module to the global namespace, in which case you can either write your code like this: require 'libxml' document = LibXML::XML::Document.new ------------------ You should probably take some time to get familiar with gem documentation. See: http://docs.rubygems.org/read/chapter/2#page10 On Nov 12, 6:22 am, Chinna Gogulapati <rails-mailing-l...@andreas- s.net> wrote: > Hi Sijo, > > What i mean is, i created a simple ruby class as follows . And in that > class i am trying to crate xml document by 'xml/libxml' lib. Even adding > require 'rubygems' also my problum has not solved. I think the libxml > gem is not installed properly. How can i check whether the gem is > installed properly or not. > > class FirstRubyProgram > require 'xml/libxml' > require 'rubygems' > > doc = XML::Document.new() > doc.root = XML::Node.new('root_node') > doc.root << XML::Node.new('elem1') > puts doc > end > > -- > Posted viahttp://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---