Skip to content

Instantly share code, notes, and snippets.

@p
Created October 5, 2011 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p/1263480 to your computer and use it in GitHub Desktop.
Save p/1263480 to your computer and use it in GitHub Desktop.
pie@jungle ~ % irb
irb(main):001:0> require 'rexml/document'
=> true
irb(main):008:0> doc=REXML::Document.new(%(<html><head><script type="text/javascript">window.jQuery || document.write('<script src="{T_ASSETS_PATH}/javascript/jquery.js"><\\/script>')</script></head></html>))
REXML::ParseException: #<REXML::ParseException: malformed XML: missing tag start
Line:
Position:
Last 80 unconsumed characters:
<\/script>')</script></head></html>>
/usr/local/lib/ruby/1.8/rexml/parsers/baseparser.rb:356:in `pull'
/usr/local/lib/ruby/1.8/rexml/parsers/treeparser.rb:22:in `parse'
/usr/local/lib/ruby/1.8/rexml/document.rb:227:in `build'
/usr/local/lib/ruby/1.8/rexml/document.rb:43:in `initialize'
(irb):8:in `new'
(irb):8:in `irb_binding'
/usr/local/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'
:0
...
malformed XML: missing tag start
Line:
Position:
Last 80 unconsumed characters:
<\/script>')</script></head></html>
Line:
Position:
Last 80 unconsumed characters:
<\/script>')</script></head></html>
from /usr/local/lib/ruby/1.8/rexml/parsers/treeparser.rb:92:in `parse'
from /usr/local/lib/ruby/1.8/rexml/document.rb:227:in `build'
from /usr/local/lib/ruby/1.8/rexml/document.rb:43:in `initialize'
from (irb):8:in `new'
from (irb):8
from :0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment