Forum: Ruby roxml in non-rails?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
953d32e245f7eb0e670bde0577f1eb43?d=identicon&s=25 Pito Salas (pitosalas)
on 2009-02-11 22:03
I have to generate some xml and have been doing a bit of a survey of
available libraries.

Roxml seems good to me. But I can't get it to work. Does it depend in
some subtle way on Rails?

For example, this simple code doesn't work for me:

require 'rubygems'
require 'roxml'


module Opml
  attr_accessor :text, :type, :xmlUrl

  class Outline
    include ROXML
    xml_reader :text
    xml_reader :type
    xml_reader :xmlUrl
  end
end

include Opml

x = Outline.new
x.text = "abbc"
puts x.to_xml


... It throws: undefined method ‘new_element’ for
LibXML::XML::Node:Class

Anyone know?
B4493ae064e6e2841f376fd1dc12b7ba?d=identicon&s=25 Ben Woosley (empact)
on 2009-02-19 03:29
(Received via mailing list)
On Feb 11, 4:02 pm, Pito Salas <r...@salas.com> wrote:
>
>
> --
> Posted viahttp://www.ruby-forum.com/.

Hey Pito,

Unfortunately, I'd had an old copy of libxml installed outside of
rubygems which was conflicting and overriding my more recent rubygems
versions, so I was only testing against the old 0.8.3 version.

Once I corrected that, I was able to reproduce your problem, and I've
since fixed it on my development branch (http://github.com/Empact/
roxml/).  You can get it there, or wait a bit for the official 2.5 to
go up on rubyforge.

Thanks for the post!
This topic is locked and can not be replied to.