problems reading xml from a db field and using it in REXML

A

aidy

I have pulled some xml from a field in the database

However, when I try to use that xml in REXML

require 'rexml/document'
doc = REXML::Document.new(xml)

I recieve this exception
c:/ruby/lib/ruby/1.8/rexml/source.rb:20:in `create_from': undefined
local variable or method `source' for REXML::SourceFactory:Class
(NameError)

This below does no raise an exception

doc = REXML::Document.new(xml.to_s)

But I don't think to_s can handle the xml, as

puts doc

Gives me invalid characters.

Aidy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top