We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
I think we should improve the implementation to handle nested CDATA more efficiently.
require "rexml/document" include REXML (1..1000000000).step(10000000) do |depth| puts "Trying depth #{depth}" string = "<?xml version=\"1.0\"?>\n" + "<root>Test</root>\n" + "<!" + "[CDATA[" * depth + "]]>\n" start = Time.now begin doc = Document.new(string) rescue Exception => e puts "Error at depth #{depth}: #{e}" break end elapsed_time = Time.now - start puts "Elapsed time: #{elapsed_time} seconds" end
Result:
Elapsed time: 24.994068928 seconds Trying depth 200000001 Elapsed time: 27.070803532 seconds Trying depth 210000001 Elapsed time: 27.870487966 seconds Trying depth 220000001 Elapsed time: 28.787843908 seconds Trying depth 230000001 [1] 4336 killed ruby test.rb
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I think we should improve the implementation to handle nested CDATA more efficiently.
Result:
The text was updated successfully, but these errors were encountered: