Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > roxml in non-rails?

Reply
Thread Tools

roxml in non-rails?

 
 
Pito Salas
Guest
Posts: n/a
 
      02-11-2009
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, mlUrl

class Outline
include ROXML
xml_reader :text
xml_reader :type
xml_reader mlUrl
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?
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Ben Woosley
Guest
Posts: n/a
 
      02-19-2009
On Feb 11, 4:02=A0pm, Pito Salas <(E-Mail Removed)> wrote:
> I have to generate some xml and have been doing a bit of a survey of
> available libraries.
>
> Roxmlseems 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
> =A0 attr_accessor :text, :type, mlUrl
>
> =A0 class Outline
> =A0 =A0 includeROXML
> =A0 =A0 xml_reader :text
> =A0 =A0 xml_reader :type
> =A0 =A0 xml_reader mlUrl
> =A0 end
> end
>
> include Opml
>
> x =3D Outline.new
> x.text =3D "abbc"
> puts x.to_xml
>
> ... It throws: undefined method =91new_element=92 for
> LibXML::XML::Node:Class
>
> Anyone know?
> --
> 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!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ROXML encoding Pavel Strnad Ruby 2 11-18-2009 03:10 PM
roxml undefined method << inriz Ruby 2 03-03-2009 06:34 AM



Advertisments