Can REXML handle long XML

L

listrecv

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?
 
D

Daniel Harple

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
 
J

Jay Levitt

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
 

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

Similar Threads


Members online

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top