Forum: Ruby Can REXML handle long XML

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.
Ccfe7d097475a32dc3ff78d6fc42c852?d=identicon&s=25 List Recv (lstrecv)
on 2006-03-07 06:40
(Received via mailing list)
I have a long chunk of XML - about 32k.  REXML::Document.new(x) gives
me an "<UNDEFINED>".  Yet I double checked the xml in a validator (by
File.write x into a file, and then loading it), and it validates fine.

Any ideas?
9358cc96c46055cd68d4a76a9aefe026?d=identicon&s=25 Daniel Harple (Guest)
on 2006-03-07 07:04
(Received via mailing list)
On Mar 7, 2006, at 6:38 AM, listrecv@gmail.com wrote:

> I have a long chunk of XML - about 32k.  REXML::Document.new(x) gives
> me an "<UNDEFINED>".  Yet I double checked the xml in a validator (by
> File.write x into a file, and then loading it), and it validates fine.
>
> Any ideas?

That's just what a REXML::Document object returns when you call
#inspect.

require 'rexml/document'
xml =<<EOS
<node>
   <xml>test</xml>
   <ignore>blah</ignore>
</node>
EOS
doc = REXML::Document.new(xml)
p doc    # -> <UNDEFINED> ... </>
puts doc # -> the xml...
puts REXML::XPath.match( doc, "//node/xml" ) # -> <xml>test</xml>


-- Daniel
A63764f318f10379c8b51349b757cf4b?d=identicon&s=25 Jay Levitt (Guest)
on 2006-03-07 13:35
(Received via mailing list)
On 6 Mar 2006 21:34:09 -0800, listrecv@gmail.com wrote:

> I have a long chunk of XML - about 32k.  REXML::Document.new(x) gives
> me an "<UNDEFINED>".  Yet I double checked the xml in a validator (by
> File.write x into a file, and then loading it), and it validates fine.
>
> Any ideas?

Definitely not the length.  I used REXML to load a 500K one-line (no
CRs)
MS Project export, with no problems.

Jay Levitt
This topic is locked and can not be replied to.