Coder Social home page Coder Social logo

rexml's Introduction

REXML

REXML was inspired by the Electric XML library for Java, which features an easy-to-use API, small size, and speed. Hopefully, REXML, designed with the same philosophy, has these same features. I've tried to keep the API as intuitive as possible, and have followed the Ruby methodology for method naming and code flow, rather than mirroring the Java API.

REXML supports both tree and stream document parsing. Stream parsing is faster (about 1.5 times as fast). However, with stream parsing, you don't get access to features such as XPath.

API

See the API documentation.

Usage

We'll start with parsing an XML document

require "rexml/document"
file = File.new( "mydoc.xml" )
doc = REXML::Document.new file

Line 3 creates a new document and parses the supplied file. You can also do the following

require "rexml/document"
include REXML  # so that we don't have to prefix everything with REXML::...
string = <<EOF
  <mydoc>
    <someelement attribute="nanoo">Text, text, text</someelement>
  </mydoc>
EOF
doc = Document.new string

So parsing a string is just as easy as parsing a file.

Support

REXML support follows the same maintenance cycle as Ruby releases, as shown on https://www.ruby-lang.org/en/downloads/branches/.

If you are running on an end-of-life Ruby, do not expect modern REXML releases to be compatible with it; in fact, it's recommended that you DO NOT use this gem, and instead use the REXML version that came bundled with your end-of-life Ruby version.

The required_ruby_version on the gemspec is kept updated on a best-effort basis by the community. Up to version 3.2.5, this information was not set. That version is known broken with at least Ruby < 2.3.

Development

After checking out the repo, run rake test to run the tests.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/rexml.

License

The gem is available as open source under the terms of the BSD-2-Clause.

rexml's People

Contributors

akr avatar alyssais avatar amatsuda avatar ayumin avatar burdettelamar avatar dependabot[bot] avatar drbrain avatar duerst avatar eban avatar hsbt avatar ivoanjo avatar kou avatar makenowjust avatar mame avatar marcandre avatar nagachika avatar naitoh avatar nobu avatar nurse avatar shugo avatar shyouhei avatar stomar avatar tenderlove avatar tompng avatar ujihisa avatar unak avatar watson1978 avatar yugui avatar zelivans avatar znz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rexml's Issues

:raw working incorrectly?

Shouldn't the treatment of foo and baz be different from the treatment of bar and bat?

    xml_string = '<root><foo>&amp;</foo><bar>&lt;</bar><baz>&gt;</baz><bat>&quot;</bat></root>'
    d = Document.new(xml_string, {raw: ['foo', 'baz']})
    d.to_s # => "<root><foo>&amp;</foo><bar>&lt;</bar><baz>&gt;</baz><bat>&quot;</bat></root>"
    root = d.root
    foo = root[0]
    bar = root[1]
    baz = root[2]
    bat = root[3]
    foo.text # => "&"
    bar.text # => "<"
    baz.text # => ">"
    bat.text # => "\""

Impossible to find an element by attribute name if the attribute value contains an escaped quote `&apos;`

I think I found a bug when a XML file contains elements having attributes composed of escaped quotes &apos; are not searchable using XPath. I've tried many different ways using XPath and I ended up looping through all the elements and comparing their gsubed attributes.

require 'rexml'

xml = <<~XML
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 http://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd">
  <file original="test.plist" source-language="en" datatype="plaintext" target-language="en">
    <header>
      <tool tool-id="com.apple.dt.xcode" tool-name="Xcode" tool-version="8.3.3" build-num="8E3004b" />
    </header>
    <body>
      <trans-unit id="test">
        <source>test</source>
        <target></target>
      </trans-unit>
      <trans-unit id="We&apos;re happy to see you">
        <source>We&apos;re happy to see you</source>
        <target></target>
      </trans-unit>
    </body>
  </file>
</xliff>
XML

@doc = REXML::Document.new(xml)
file = 'test.plist'
id = 'test'
puts REXML::XPath.first(@doc, "//file[@original='#{file}']/body/trans-unit[@id='#{id}']").inspect

# => <trans-unit id='test'> ... </> Perfect

file = 'test.plist'
id = 'We&apos;re happy to see you'
puts REXML::XPath.first(@doc, "//file[@original='#{file}']/body/trans-unit[@id='#{id}']").inspect

# => nil ! Let's try to find in in different ways

file = 'test.plist'
id = "We're happy to see you"
puts REXML::XPath.first(@doc, "//file[@original='#{file}']/body/trans-unit[@id='#{id}']").inspect

# => nil

file = 'test.plist'
id = "We''re happy to see you"
puts REXML::XPath.first(@doc, "//file[@original='#{file}']/body/trans-unit[@id='#{id}']").inspect

# => nil

file = 'test.plist'
id = "We\'re happy to see you"
puts REXML::XPath.first(@doc, "//file[@original='#{file}']/body/trans-unit[@id='#{id}']").inspect

# => nil

file = 'test.plist'
id = "We\'re happy to see you"

REXML::XPath.each(@doc, "//file[@original='#{file}']/body/trans-unit") do |element|
  puts element.inspect if element.attributes['id'].gsub('&apos;', "'") == id
end

# => <trans-unit id='We&apos;re happy to see you'> ... </>

Editing an element and generating XML files using the `{attribute_quote: :quote}` wrongly escapes quotes in attributes

require 'rexml'

xml = <<~XML
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 http://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd">
  <file original="test.plist" source-language="en" datatype="plaintext" target-language="en">
    <header>
      <tool tool-id="com.apple.dt.xcode" tool-name="Xcode" tool-version="8.3.3" build-num="8E3004b" />
    </header>
    <body>
      <trans-unit id="test">
        <source>test</source>
        <target></target>
      </trans-unit>
      <trans-unit id="We're happy to see you">
        <source>We're happy to see you</source>
        <target></target>
      </trans-unit>
    </body>
  </file>
</xliff>
XML

@doc = REXML::Document.new(xml)
REXML::XPath.first(@doc, '//trans-unit').attributes['id'] = "I'm here"
puts @doc.to_s
<?xml version='1.0' encoding='UTF-8'?>
<xliff xsi:schemaLocation='urn:oasis:names:tc:xliff:document:1.2 http://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd' version='1.2' xmlns='urn:oasis:names:tc:xliff:document:1.2' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
  <file datatype='plaintext' original='test.plist' source-language='en' target-language='en'>
    <header>
      <tool build-num='8E3004b' tool-id='com.apple.dt.xcode' tool-name='Xcode' tool-version='8.3.3'/>
    </header>
    <body>
      <trans-unit id='I&apos;m here'>
        <source>test</source>
        <target/>
      </trans-unit>
      <trans-unit id='We&apos;re happy to see you'>
        <source>We're happy to see you</source>
        <target/>
      </trans-unit>
    </body>
  </file>
</xliff>

All good! โœ…

When using {attribute_quote: :quote} to generate files with double quoted attributes, not editing anything there:

@doc = REXML::Document.new(xml, {attribute_quote: :quote})
puts @doc.to_s
<?xml version='1.0' encoding='UTF-8'?>
<xliff xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 http://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd" version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <file datatype="plaintext" original="test.plist" source-language="en" target-language="en">
    <header>
      <tool build-num="8E3004b" tool-id="com.apple.dt.xcode" tool-name="Xcode" tool-version="8.3.3"/>
    </header>
    <body>
      <trans-unit id="test">
        <source>test</source>
        <target/>
      </trans-unit>
      <trans-unit id="We're happy to see you">
        <source>We're happy to see you</source>
        <target/>
      </trans-unit>
    </body>
  </file>
</xliff>

All good too! โœ…

But if I edit a trans-unit:

@doc = REXML::Document.new(xml, {attribute_quote: :quote})
REXML::XPath.first(@doc, '//trans-unit').attributes['id'] = "I'm here"
puts @doc.to_s
<?xml version='1.0' encoding='UTF-8'?>
<xliff xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 http://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd" version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <file datatype="plaintext" original="test.plist" source-language="en" target-language="en">
    <header>
      <tool build-num="8E3004b" tool-id="com.apple.dt.xcode" tool-name="Xcode" tool-version="8.3.3"/>
    </header>
    <body>
      <trans-unit id="I&apos;m here">
        <source>test</source>
        <target/>
      </trans-unit>
      <trans-unit id="We're happy to see you">
        <source>We're happy to see you</source>
        <target/>
      </trans-unit>
    </body>
  </file>
</xliff>

(Note the <trans-unit id="I&apos;m here">). It should be <trans-unit id="I'm here">. The element we edited has its quote incorrectly HTML-escaped, while the one we didn't edit is correctly unescaped.

It looks like editing an element makes it loose its context[:attribute_quote:].

REXML::Validation::RelaxNG

Let openmath2.rng be the file https://www.openmath.org/standard/om20-2019-07-01/openmath2.rng

If I try to validate using that file, I get the following error:

$ gem list |grep rexml
rexml (default: 3.2.3)
$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
$ irb -v
irb 1.2.1 (2019-12-24)
$ irb
irb(main):001:0> require "rexml/validation/relaxng"
=> true
irb(main):002:0> schema = File.new( "openmath2.rng" )
irb(main):003:0> validator = REXML::Validation::RelaxNG.new( schema )
Traceback (most recent call last):
        6: from /usr/bin/irb:23:in `<main>'
        5: from /usr/bin/irb:23:in `load'
        4: from /usr/lib/ruby/gems/2.7.0/gems/irb-1.2.1/exe/irb:11:in `<top (required)>'
        3: from (irb):3
        2: from (irb):3:in `new'
        1: from /usr/lib/ruby/2.7.0/rexml/validation/relaxng.rb:89:in `initialize'
NameError (uninitialized constant REXML::Validation::RelaxNG::AnyName)
irb(main):004:0>

Apart the AnyName, how exactly is used REXML::Validation::RelaxNG ? I didn't find the documentation about it

:xmldecl needs to use :attribute_quote context setting

History of the issue

Moving ruby/ruby#496 (comment) to this repo -> ruby/rexml which in turn is a copy of https://redmine.ruby-lang.org/issues/9367#note-10

The crux of the issue (original comment)

from @bearmini

REXML uses double quotes for quoting attributes if :attribute_quote is specified as document's context like below:

doc = REXML::Document.new
doc.context[:attribute_quote] = :quote

This looks working well on all elements but has no effect for xml declaration (i.e. ) if it exists.

Even if I specify (({doc.context[:attribute_quote] = :quote})), I will get this:

<?xml version='1.0' encoding='UTF-8' standalone='true'?>

The expected result is:

<?xml version="1.0" encoding="UTF-8" standalone="true"?>

Confirming the problem and the rationale

from @konung

I ran into the same issue. Since there seems to be a question of "why would you want to do that?", based on the discussion on Rubymine, I'd like to add a comment.
I came across this when dealing with XML generated for consumption by a Java (Jetty) based service (used in ebXML exchange popular in Automotive industry).

  1. It complains the file is malformed and won't parse it if the XML declaration is not quoted, like the rest of the document.
  2. It also doesn't want to parse single quoted attributes in XML file. ( Specifying doc = REXML::Document.new(source); doc.context[:attribute_quote] = :quote -> works, just not for the xml declaration!)
  3. Finally it doesn't like '\n' UNIX-style line endings, and wants Windows-style endings ( I sidestepped the issue by using File.write(src, str, crlf_newline: true) when generating final file. )

So the only remaining problem is 1 - right now I'm working around the issue by parsing the file before saving and replacing single quotes with double quotes in xml declaration. But I wanted to explain why this is a useful option, despite not being 100% true to the standard.

Thank you

Nokogori

I tested the same xml in Nokogiri, and it seems to convert quotes in the xmldec to double quotes, like the rest of the document.

While the standard supports both double and single quotes, double quotes seems to have more consistent support throughout different implementations. (IMHO)

Responds even after `:characters` has closed the root tag.

  • sax_test.rb
require 'rexml/parsers/sax2parser'
require 'libxml-ruby'
require 'nokogiri'

xml = <<EOS
<root>
</root>
EOS

class Listener
  def method_missing(name, *args)
    p [name, *args]
  end
end

puts "REXML"
parser = REXML::Parsers::SAX2Parser.new(xml)
parser.listen(Listener.new)
parser.parse

puts ""
puts "LibXML"
parser = LibXML::XML::SaxParser.string(xml)
parser.callbacks = Listener.new
parser.parse

puts ""
puts "Nokogiri"
parser = Nokogiri::XML::SAX::Parser.new(Listener.new)
parser.parse(xml)
$ ruby sax_test.rb
REXML
[:start_document]
[:start_element, nil, "root", "root", {}]
[:progress, 6]
[:characters, "\n"]
[:progress, 7]
[:end_element, nil, "root", "root"]
[:progress, 14]
[:characters, "\n"] #<= This
[:progress, 15]
[:end_document]

LibXML
[:on_start_document]
[:on_start_element_ns, "root", {}, nil, nil, {}]
[:on_characters, "\n"]
[:on_end_element_ns, "root", nil, nil]
[:on_end_document]

Nokogiri
[:start_document]
[:start_element_namespace, "root", [], nil, nil, []]
[:characters, "\n"]
[:end_element_namespace, "root", nil, nil]
[:end_document]

REXML responds even after :characters have closed the root tag.
I don't think[:characters, "\n"] should respond after the root tag is closed.
What do you think?

REXML is no longer pure ruby

This is a deliberate duplicate of #131, which appears to be mired in some unrelated discussion.

We use REXML because it is pure ruby and thus can be installed in environments that are limited in their native compilation support.

By requiring strscan, REXML no longer is pure Ruby.

REXML now is no longer useful for these environments.

I have pinned to <=3.2.6, but of course I'd like to have security fixes going forward.

Is it possible to unconstrain strscan or fallback if not available?

Hello, as I understand it, strscan is a standard gem which means Ruby will always include some version of it. One can update the version via gem, but then it must be compiled on the target system as it isn't provided as a binary gem. Recent versions of strscan seem to require a Ruby compiled with libonig support[1], which may not be available. If I'm understanding all of this correctly, this effectively limits the kinds of Ruby installs where rexml can be used. (EDIT: I misinterpreted log output. libonig is optional. As mentioned here, workarounds include ensuring build-essential is installed (gcc and make) or using an earlier version of rexml as mentioned below.)

If your gem directly requires rexml, the easiest way to get around this is to require an earlier version of rexml that doesn't use strscan (e.g., 3.2.6). This isn't a great solution as we miss out on updates. And if rexml is further down the dependency chain, even this may not be viable.

  • Does rexml need to constrain the version of strscan? Could we leave it unpinned for better compatibility? (Potentially related to 372daf1)
  • If the version constraint is needed, can rexml fallback to the old routines if the correct strscan version is unavailable? (or something that uses an earlier version of strscan?)

Apologies if I'm off the mark. By no means a Ruby expert.

[1] https://github.com/ruby/strscan/blob/ca66d48c47d2b17753a660c628606f0bf788d594/ext/strscan/extconf.rb#L5-L6

Backporting recent CVE fixes to 3.2.x branch

As with many other folks we've picked up the recent CVE and tried to fix it, but run into issues with transitive dependencies.

We have a dependency chain that includes activemerchant that hasn't updated their dependency on rexml yet and it would be helpful if we could mitigate the CVE without needing to bump the minor version of the rexml (because of version restrictions).

I took a look at the changes but they seem spread across multiple different files and features and I couldn't make a call about how difficult back-porting the fix would be.

Unicode noncharacters

As of the current master (fc94069, near 3.2.6), REXML rejects Unicode noncharacters like U+FFFFย :

2.7.1 :001 > require "rexml/document"
 => true 
2.7.1 :002 > REXML::Document.new("&#x03B1;").text
 => "ฮฑ" 
2.7.1 :003 > REXML::Document.new("&#xFFFF;").text
Traceback (most recent call last):
        9: from /usr/share/rvm/rubies/ruby-2.7.1/bin/irb:23:in `<main>'
        8: from /usr/share/rvm/rubies/ruby-2.7.1/bin/irb:23:in `load'
        7: from /usr/share/rvm/rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/irb-1.2.3/exe/irb:11:in `<top (required)>'
        6: from (irb):3
        5: from (irb):3:in `new'
        4: from /home/frederic/.rvm/gems/ruby-2.7.1/gems/rexml-3.2.6/lib/rexml/document.rb:101:in `initialize'
        3: from /home/frederic/.rvm/gems/ruby-2.7.1/gems/rexml-3.2.6/lib/rexml/document.rb:448:in `build'
        2: from /home/frederic/.rvm/gems/ruby-2.7.1/gems/rexml-3.2.6/lib/rexml/parsers/treeparser.rb:21:in `parse'
        1: from /home/frederic/.rvm/gems/ruby-2.7.1/gems/rexml-3.2.6/lib/rexml/parsers/treeparser.rb:96:in `rescue in parse'
REXML::ParseException (#<RuntimeError: Illegal character "&#xFFFF;" in raw string "&#xFFFF;">)
/home/frederic/.rvm/gems/ruby-2.7.1/gems/rexml-3.2.6/lib/rexml/text.rb:163:in `block in check'
/home/frederic/.rvm/gems/ruby-2.7.1/gems/rexml-3.2.6/lib/rexml/text.rb:155:in `scan'
/home/frederic/.rvm/gems/ruby-2.7.1/gems/rexml-3.2.6/lib/rexml/text.rb:155:in `check'
/home/frederic/.rvm/gems/ruby-2.7.1/gems/rexml-3.2.6/lib/rexml/text.rb:122:in `initialize'
/home/frederic/.rvm/gems/ruby-2.7.1/gems/rexml-3.2.6/lib/rexml/parsers/treeparser.rb:47:in `new'
/home/frederic/.rvm/gems/ruby-2.7.1/gems/rexml-3.2.6/lib/rexml/parsers/treeparser.rb:47:in `parse'
/home/frederic/.rvm/gems/ruby-2.7.1/gems/rexml-3.2.6/lib/rexml/document.rb:448:in `build'
/home/frederic/.rvm/gems/ruby-2.7.1/gems/rexml-3.2.6/lib/rexml/document.rb:101:in `initialize'
...
Illegal character "&#xFFFF;" in raw string "&#xFFFF;"
Line: 1
Position: 8
Last 80 unconsumed characters:

It looks like noncharacters are voluntarily excluded, according to

| \xEF\xBF[\x80-\xBD] # excluding U+fffe and U+ffff
.

However, Unicode standard 14.0.0, section 23.7 ยซ Noncharactersโ€ฏยป (https://www.unicode.org/versions/Unicode14.0.0/ch23.pdf#G12612) states:

Applications are free to use any of these noncharacter code points internally. They have no
standard interpretation when exchanged outside the context of internal use. However, they
are not illegal in interchange, nor does their presence cause Unicode text to be ill-formed.

I believe REXML should therefore not forbid these noncharacters, and even forbid as few characters as possible. The current restrictions are limiting for using REXML as a neutral carrier to transmit arbitrary Unicode strings.

Best regards.

Unreleased rexml 3.1.9.1 is shipped by Ruby 2.6.8

Ruby 2.6.8 ships with what it reports as rexml 3.1.9.1:

$ ruby -rrexml/rexml -e "p REXML::VERSION"
"3.1.9.1"

This version does not exist on rubygems.org and does not appear to have been released. This prevents JRuby from shipping it, since we source all gem-based standard libraries from released gems.

Could we get this released, please? ๐Ÿ˜€

Can't parse large XML

For example, we can't parse an XML of Wikipedia: https://dumps.wikimedia.org/enwiki/latest/enwiki-latest-pages-articles.xml.bz2

REXML::ParseException: #<RangeError: integer 2147501889 too big to convert to 'int'>
/tmp/local/lib/ruby/gems/3.4.0+0/gems/rexml-3.3.0/lib/rexml/source.rb:127:in 'StringScanner#pos='
/tmp/local/lib/ruby/gems/3.4.0+0/gems/rexml-3.3.0/lib/rexml/source.rb:127:in 'REXML::Source#position='
/tmp/local/lib/ruby/gems/3.4.0+0/gems/rexml-3.3.0/lib/rexml/parsers/baseparser.rb:447:in 'REXML::Parsers::BaseParser#pull_event'
/tmp/local/lib/ruby/gems/3.4.0+0/gems/rexml-3.3.0/lib/rexml/parsers/baseparser.rb:207:in 'REXML::Parsers::BaseParser#pull'
/tmp/local/lib/ruby/gems/3.4.0+0/gems/rexml-3.3.0/lib/rexml/parsers/streamparser.rb:20:in 'REXML::Parsers::StreamParser#parse'
/tmp/local/lib/ruby/gems/3.4.0+0/gems/red-datasets-0.1.7/lib/datasets/wikipedia.rb:51:in 'block in Datasets::Wikipedia#each'
/tmp/local/lib/ruby/gems/3.4.0+0/gems/red-datasets-0.1.7/lib/datasets/dataset.rb:78:in 'block (2 levels) in Datasets::Dataset#extract_bz2'
/tmp/local/lib/ruby/gems/3.4.0+0/gems/red-datasets-0.1.7/lib/datasets/dataset.rb:56:in 'IO.pipe'
/tmp/local/lib/ruby/gems/3.4.0+0/gems/red-datasets-0.1.7/lib/datasets/dataset.rb:56:in 'block in Datasets::Dataset#extract_bz2'
/tmp/local/lib/ruby/gems/3.4.0+0/gems/red-datasets-0.1.7/lib/datasets/dataset.rb:55:in 'IO.pipe'
/tmp/local/lib/ruby/gems/3.4.0+0/gems/red-datasets-0.1.7/lib/datasets/dataset.rb:55:in 'Datasets::Dataset#extract_bz2'
/tmp/local/lib/ruby/gems/3.4.0+0/gems/red-datasets-0.1.7/lib/datasets/wikipedia.rb:71:in 'Datasets::Wikipedia#open_data'
/tmp/local/lib/ruby/gems/3.4.0+0/gems/red-datasets-0.1.7/lib/datasets/wikipedia.rb:48:in 'Datasets::Wikipedia#each'
...
Exception parsing
Line: -1
Position: -1
Last 80 unconsumed characters:
/text>

(ruby -r datasets -e 'Datasets::Wikipedia.new.each {}' will reproduce this.)

We need to drop parsed content in StringScanner of REXML::Source to parse large XML.

Prepare continuous benchmarking

Objective

  • Prevent/detect performance regression automatically

Requirements

  • Detect performance regression in PR (CI is failed)
  • Detect performance regression in main commits (CI is failed)
  • Easy to maintain over correctness
    • For example: We don't want to maintain our server even if GitHub hosted runner may not provide stable computation resource.

Nice to have

  • Visualize performance trends

\r is converted into \n

In this example, in an XML document, the character \r is converted to \n.
It was instead expected to keep \r

$ gem list |grep rexml
rexml (default: 3.2.3)
$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
$ irb -v
irb 1.2.1 (2019-12-24)
$ irb
irb(main):001:0> require "rexml/document"
=> true
irb(main):002:0> doc = REXML::Document.new "<a>\r</a>"
irb(main):003:0> doc.root.text
=> "\n"
irb(main):004:0>

ParseException could not get message when xml with invalid characters

I get the following backtrace message when i load xml:

incompatible character encodings: UTF-8 and ASCII-8BIT
/usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rexml-3.2.2/lib/rexml/parseexception.rb:32:in `to_s'

the xml encoding is UTF-8 and with invalid characters, but parseexception to_s use ASCII-8BIT encoding, so here to_s will raise an exception with encoding fail, user will not get the actual error information in xml

`each_recursive` is extremely slow

REXML::Node#each_recursive is a fundamental operation to traverse XML nodes. In particular, CSS selector uses this method heavily.

Unfortunately, this method is extremely slow. The following Gist contains a tiny (but mostly equivalent) each_recursive implementation and their benchmarks.

https://gist.github.com/makenowjust/b4852a59e53f0c85c740818c75303d5e

And, the below is a result of this script on my laptop (Apple M1 Pro, 14 inch, 32 GB) and Ruby 3.3.2.

$ ruby bench.rb
       user     system      total        real
   each_recursive  2.421999   0.008742   2.430741 (  2.453438)
my_each_recursive  0.057647   0.000049   0.057696 (  0.058718)
$ ruby --yjit bench.rb
       user     system      total        real
   each_recursive  1.613353   0.008227   1.621580 (  1.625374)
my_each_recursive  0.025493   0.000124   0.025617 (  0.025748)

Yes, REXML's each_recursive is ~50x (or ~80x with YJIT) slower than my tiny implementation.

I believe REXML does a lot of extra work, and we can make it faster.

XPath Comparison Unexpected Error

Hi again,

There seems to be a bug regarding boolean comparisons in the XPath evaluation.

Executing false()>=false() throws a NoMethodError (undefined method '>=' for false:FalseClass) Error.
Expected result: true

This leads to more crashes e.g when comparing empty-node sets with a boolean:
The expression /nonexistent>=false() throws an error as well.

Executing false()=false() however leads to the correct result true.

Complete Error:

Testing library: rexml , xpath: false()>=false()
Traceback (most recent call last):
        10: from /app/libraries/rexml/rexml.rb:17:in `<main>'
         9: from /usr/local/rvm/gems/ruby-2.6.3/gems/rexml-3.2.1/lib/rexml/xpath.rb:78:in `match'
         8: from /usr/local/rvm/gems/ruby-2.6.3/gems/rexml-3.2.1/lib/rexml/xpath_parser.rb:70:in `parse'
         7: from /usr/local/rvm/gems/ruby-2.6.3/gems/rexml-3.2.1/lib/rexml/xpath_parser.rb:133:in `match'
         6: from /usr/local/rvm/gems/ruby-2.6.3/gems/rexml-3.2.1/lib/rexml/xpath_parser.rb:345:in `expr'
         5: from /usr/local/rvm/gems/ruby-2.6.3/gems/rexml-3.2.1/lib/rexml/xpath_parser.rb:811:in `equality_relational_compare'
         4: from /usr/local/rvm/gems/ruby-2.6.3/gems/rexml-3.2.1/lib/rexml/syncenumerator.rb:27:in `each'
         3: from /usr/local/rvm/gems/ruby-2.6.3/gems/rexml-3.2.1/lib/rexml/syncenumerator.rb:27:in `times'
         2: from /usr/local/rvm/gems/ruby-2.6.3/gems/rexml-3.2.1/lib/rexml/syncenumerator.rb:28:in `block in each'
         1: from /usr/local/rvm/gems/ruby-2.6.3/gems/rexml-3.2.1/lib/rexml/xpath_parser.rb:814:in `block in equality_relational_compare'
/usr/local/rvm/gems/ruby-2.6.3/gems/rexml-3.2.1/lib/rexml/xpath_parser.rb:893:in `compare': undefined method `>=' for false:FalseClass (NoMethodError)

Furthermore we found that executing number(false()) results in NaN which is incorrect. Instead zero should be returned.

I hope this helps and best regards,
Mirko

when element name like 'saml2:AttributeStatement', how to quick parse?

require "rexml/document"
include REXML
string = <<EOF
  <saml2:AttributeStatement>
      <saml2:Attribute Name="email" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
         <saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">user.email</saml2:AttributeValue>
      </saml2:Attribute>
      <saml2:Attribute Name="first_name" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
         <saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">user.firstName</saml2:AttributeValue>
      </saml2:Attribute>
   </saml2:AttributeStatement>
EOF

doc = Document.new string
puts(doc)

ERRO:
in `block in pull_event': Undefined prefix saml2 found (REXML::UndefinedNamespaceException)

A new line is written for no xml declaration

I tested with ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu] and rexml revision ff785c9.

When I parse a document without an xml declaration then it is not printed to output.

Output from following script (out see a new line after first "Output" but not after second.

No declaration
<<< Input
<html><body><p>Test</p></body></html>
>>>
<<< Output

<html><body><p>Test</p></body></html>
>>>

Declaration
<<< Input
<?xml version="1.0" encoding="UTF-8" ?><html><body><p>Test</p></body></html>
>>>
<<< Output
<?xml version='1.0' encoding='UTF-8'?>
<html><body><p>Test</p></body></html>
>>>

I used this script.

require "rexml/document"

def write_formatted(formatter, document_text, comment)
  puts
  puts comment
  puts "<<< Input"
  puts document_text
  puts ">>>"
  puts "<<< Output"
  document = REXML::Document.new document_text
  puts formatter.write(document, "")
  puts ">>>"
end

doc1_text = '<html><body><p>Test</p></body></html>'
doc2_text = '<?xml version="1.0" encoding="UTF-8" ?>' + doc1_text

formatter = REXML::Formatters::Pretty.new
write_formatted formatter, doc1_text, "No declaration"
write_formatted formatter, doc2_text, "Declaration"

Source code looks like there is done some checks to suppress this newlines but they remain.

Node set predicate not working

Hi,

I'm upgrading Ruby from 2.4.5 to 2.6.5 and the rexml behavior seems to have changed. We actually had some xpaths that were wrong that were working with the previous version. However, in correcting them I'm seeing this issue:

I expect the following example to return just one node.

xml_string = <<EOF
<div>
  <div>
    <test>1</test>
    <test>2</test>
  </div>
  <div>
    <test>1</test>
    <test>2</test>
  </div>
</div>
EOF

xml_doc = REXML::Document.new(xml_string)

nodes = REXML::XPath.match(xml_doc, '(/div/div/test[1])[1]')

It returns two nodes though.

>nodes.count
=> 2
> nodes.map(&:text)
=> ["1", "1"]

From my understanding placing an xpath subexpression in this (...)[1] should only return the first from the node set.

-John

Inverse to XPathParser::parse?

The following REXML script

require 'rexml'

parsed = REXML::Parsers::XPathParser.new.parse('/a[b/text()=concat("c","d")]')
puts "#{parsed}"
puts ""
appreviated = REXML::Parsers::XPathParser.new.abbreviate parsed
puts "#{appreviated}"

outputs

[:document, :child, :qname, "", "a", :predicate, [:eq, [:child, :qname, "", "b", :child, :text], [:function, "concat", [[:literal, "c"], [:literal, "d"]]]]]

/a[ b/text() = concat( UNKNOWN([:literal, "c"])/UNKNOWN([:literal, "d"]) ) ]

I know about the warning against using REXML::Parsers::XPathParser but is there any way to get back the xpath string /a[b/text()=concat("c","d")] from its parsed/tokenized version?

I'm working on an application that requires heavy manipulation of xpaths (version 1.0) and am looking for a library to help with this.

REXML version: 3.2.5

Proper Semantic Versioning

@kou @nobu, the two most recent releases 3.2.7 and 3.2.8 should be major versions as they introduce strscan which seems to require some native extensions and compilation on systems. This is breaking my world with folks using Chef. Can you please yank those and make this 4.x.x or something?

For Chef folks looking for a fix, add the following to your cookbooks metadata.rb:

# Temporary Workaround (https://github.com/ruby/rexml/issues/131)
gem 'rexml', '= 3.2.6'

You can also install gcc in your kitchen using:

lifecycle:
  post_create:
    # Temporary Workaround (https://github.com/ruby/rexml/issues/131)
    - remote: sudo yum install -y gcc

Thanks

Problem with context raw?

Running ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [i386-mingw32]

  xml_string = '<root><foo>&amp;</foo><bar>&lt;</bar><baz>&gt;</baz><bat>&quot;</bat></root>'
  d = Document.new(xml_string, {raw: ['foo', 'baz']})
  d.to_s # => "<root><foo>&amp;</foo><bar>&lt;</bar><baz>&gt;</baz><bat>&quot;</bat></root>"
  root = d.root # => <root> ... </>
  foo, bar, baz, bat = *d.root
  # Each is an Element object:
  [foo, bar, baz, bat].map {|e| e.class }.uniq # => [REXML::Element]
  # Each element is marked as raw/not-raw as appropriate:
  [foo, bar, baz, bat].map {|e| e.raw } # => [true, false, true, false]
  # The first child of each is a Text object:
  [foo, bar, baz, bat].map {|e| e.first.class }.uniq # => [REXML::Text]
  # Each text is marked as raw/not-raw as appropriate:
  [foo, bar, baz, bat].map {|e| e.first.raw } # => [true, true, true, true]

Is this correct? I expected that last result to be [true, false, true, false].

Improve the performance using the hints by rubocop-performance and fasterer

rubocop-performance (see https://github.com/rubocop-hq/rubocop-performance ) says:

Offenses:

/usr/lib/ruby/2.7.0/rexml/attlistdecl.rb:45:7: C: Performance/InefficientHashSearch: Use #key? instead of #keys.include?.
      @pairs.keys.include? key
      ^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/doctype.rb:201:7: C: Performance/RegexpMatch: Use match? instead of =~ when MatchData is not used.
      quoted_string =~ /^[\'\"].*[\'\"]$/ ?
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/element.rb:255:43: C: Performance/RegexpMatch: Use match? instead of =~ when MatchData is not used.
        prefix = "xmlns:#{prefix}" unless prefix =~ /^xmlns:/
                                          ^^^^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/entity.rb:44:12: C: Performance/RegexpMatch: Use match? instead of =~ when MatchData is not used.
        if stream[2] =~ /SYSTEM|PUBLIC/
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/node.rb:56:9: C: Performance/RedundantBlockCall: Use yield instead of block.call.
        block.call(node)
        ^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/node.rb:65:24: C: Performance/RedundantBlockCall: Use yield instead of block.call.
        return node if block.call(node)
                       ^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/parseexception.rb:32:67: C: Performance/StringReplacement: Use tr instead of gsub.
        err << @source.buffer[0..80].force_encoding("ASCII-8BIT").gsub(/\n/, ' ')
                                                                  ^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/baseparser.rb:476:25: C: Performance/RegexpMatch: Use match? instead of =~ when MatchData is not used.
        return false if /\AUTF-16\z/i =~ xml_declaration_encoding
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/pullparser.rb:73:29: C: Performance/RegexpMatch: Use match? instead of =~ when MatchData is not used.
            event[2] unless event[2] =~ /PUBLIC|SYSTEM/
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/treeparser.rb:81:54: C: Performance/RegexpMatch: Use match? instead of =~ when MatchData is not used.
              entities[ event[1] ] = event[2] unless event[2] =~ /PUBLIC|SYSTEM/
                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/xpathparser.rb:304:14: C: Performance/RegexpMatch: Use match? instead of !~ when MatchData is not used.
          if path !~ /^\s*\)/
             ^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/xpathparser.rb:539:41: C: Performance/RegexpMatch: Use match? instead of =~ when MatchData is not used.
        rest = LocationPath(rest, n) if rest =~ /\A[\/\.\@\[\w*]/
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/quickpath.rb:108:49: C: Performance/RegexpMatch: Use match? instead of =~ when MatchData is not used.
      matches = filter( elements.dup, rest ) if axe_name =~ /-or-self$/u
                                                ^^^^^^^^^^^^^^^^^^^^^^^^

49 files inspected, 13 offenses detected


fasterer (see https://github.com/DamirSvrtan/fasterer) says:

validation/relaxng.rb:416 Calling argumentless methods within blocks is slower than using symbol to proc.
validation/relaxng.rb:523 Calling argumentless methods within blocks is slower than using symbol to proc.

parsers/xpathparser.rb:602 For loop is slower than using each.

parsers/baseparser.rb:381 For loop is slower than using each.

formatters/default.rb:70 Calling argumentless methods within blocks is slower than using symbol to proc.

xpath_parser.rb:105 For loop is slower than using each.
xpath_parser.rb:120 For loop is slower than using each.
xpath_parser.rb:458 Enumerable#sort is slower than Enumerable#sort_by.
xpath_parser.rb:590 Using each_with_index is slower than while loop.

quickpath.rb:88 Calling argumentless methods within blocks is slower than using symbol to proc.
quickpath.rb:133 Calling argumentless methods within blocks is slower than using symbol to proc.
quickpath.rb:135 Calling argumentless methods within blocks is slower than using symbol to proc.
quickpath.rb:138 Calling argumentless methods within blocks is slower than using symbol to proc.

node.rb:54 Calling blocks with call is slower than yielding.
node.rb:63 Calling blocks with call is slower than yielding.

functions.rb:42 Calling argumentless methods within blocks is slower than using symbol to proc.

element.rb:1068 Hash#fetch with second argument is slower than Hash#fetch with block.
element.rb:1075 Hash#fetch with second argument is slower than Hash#fetch with block.
element.rb:1128 Hash#fetch with second argument is slower than Hash#fetch with block.
element.rb:1212 Hash#fetch with second argument is slower than Hash#fetch with block.
element.rb:1246 Calling argumentless methods within blocks is slower than using symbol to proc.

doctype.rb:283 Use attr_reader for reading ivars.

49 files inspected, 22 offenses detected

XPath with leading predicate gives error

I'm updating from ruby 2.2 and REXML is now giving an error whenever an XPath expression starts with a predicate.

Example

xml_string = <<EOF
<A>
  <B/>
</A>
EOF

xml_doc = REXML::Document.new(xml_string)

puts REXML::XPath.first(xml_doc.elements['A'], '[B]')

Ruby 2.2:

<A>
  <B/>
</A>

Ruby 2.7:

Traceback (most recent call last):
        4: from C:/Users/shorowit/Desktop/test.rb:13:in `<main>'
        3: from C:/Ruby27-x64/lib/ruby/2.7.0/rexml/xpath.rb:39:in `first'
        2: from C:/Ruby27-x64/lib/ruby/2.7.0/rexml/xpath_parser.rb:75:in `parse'
        1: from C:/Ruby27-x64/lib/ruby/2.7.0/rexml/xpath_parser.rb:138:in `match'
C:/Ruby27-x64/lib/ruby/2.7.0/rexml/xpath_parser.rb:427:in `expr': [BUG] Unexpected path: <:predicate>: <[[:child, :qname, "", "B"]]> (RuntimeError)

Behavior Change from 3.3.1 -> 3.3.2

TL,DR:

  • the 3.3.1 version was more robust against bad input
  • the 3.3.2 version breaks on bad input

Not sure if you want to treat this as a regression.

Example

We found that some improper input would still be parsed correctly in 3.3.1, but breaks parsing in 3.3.2.

Some gem in combination with a VCR cassette containing proper XML produces poorly formatted output when doing response.to_s, and escapes what are the actual string delimiters " of the response data, and then appends a \n to it.

So "string" becomes `"\"string\"\n" ๐Ÿคฆ

Clearly incorrect data ๐Ÿคฆ but 3.3.1 was robust against it.

pry(RestClient)> xml = response.to_s
=> "\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\n  <SomeResponse>\n    <Purchase>\n      <Id>123</Id>\n      <SyncToken>0</SyncToken>\n      <MetaData>\n        <CreateTime>2021-11-23T04:32:03-08:00</CreateTime>\n        <LastUpdatedTime>2021-11-23T04:32:03-08:00</LastUpdatedTime>\n      </MetaData>\n      <TxnDate>2021-11-23</TxnDate>\n      <CurrencyRef>USD</CurrencyRef>\n      <Line>\n        <Id>1</Id>\n        <Description>some description</Description>\n        <Amount>123.45</Amount>\n        <DetailType>AccountBasedExpenseLineDetail</DetailType>\n        <AccountBasedExpenseLineDetail>\n          <CustomerRef>1</CustomerRef>\n          <AccountRef>12</AccountRef>\n          <BillableStatus>NotBillable</BillableStatus>\n          <TaxCodeRef>NON</TaxCodeRef>\n        </AccountBasedExpenseLineDetail>\n      </Line>\n      <AccountRef>34</AccountRef>\n      <PaymentType>CreditCard</PaymentType>\n      <EntityRef>1</EntityRef>\n      <Credit>false</Credit>\n      <TotalAmt>123.45</TotalAmt>\n      <PurchaseEx>\n        <NameValue>\n          <Name>TxnType</Name>\n          <Value>99</Value>\n        </NameValue>\n      </PurchaseEx>\n    </Purchase>\n  </SomeResponse>\"\n"

# with 3.3.1:

pry(main)> Hash.from_xml xml
=> {"SomeResponse"=>
  {"Purchase"=>
    {"Id"=>"123",
     "SyncToken"=>"0",
     "MetaData"=>{"CreateTime"=>"2021-11-23T04:32:03-08:00", "LastUpdatedTime"=>"2021-11-23T04:32:03-08:00"},
     "TxnDate"=>"2021-11-23",
     "CurrencyRef"=>"USD",
     "Line"=>{"Id"=>"1", "Description"=>"some transaction", "Amount"=>"123.45", "DetailType"=>"AccountBasedExpenseLineDetail", "AccountBasedExpenseLineDetail"=>{"CustomerRef"=>"1", "AccountRef"=>"12", "BillableStatus"=>"NotBillable", "TaxCodeRef"=>"NON"}},
     "AccountRef"=>"34",
     "PaymentType"=>"CreditCard",
     "EntityRef"=>"1",
     "Credit"=>"false",
     "TotalAmt"=>"123.45",
     "PurchaseEx"=>{"NameValue"=>{"Name"=>"TxnType", "Value"=>"99"}}}}}

# with 3.3.2:

pry(RestClient)> Hash.from_xml xml
REXML::ParseException: Malformed XML: Extra content at the end of the document (got '"
')
Line: 36
Position: 1176
Last 80 unconsumed characters:

How to not escape ampersand in the attribute of an element?

Hi!

I am trying to create an element with attribute that looks like:

<MyElement
    myAttribute = "Hello&#10;World">
</MyElement>

which I am doing the the following code:

my_attribute = REXML::Text.new('Hello&#10;World')

my_element = REXML::Element.new('MyElement')
my_element.attributes['myAttribute'] = my_attribute

my_element.to_s

and I get Hello&amp;amp;#10;World in the attribute. I also tried using the raw flag for the Text and the { :raw => :all } context for the Element but that removes only a single amp;.

Am I missing something? How can I get to my desired output?

Use bundled rexml for Ruby 2.4, 2.5, 2.6 and 2.7

Based on the discussion at googleapis/google-api-ruby-client#871

I'm wondering if it is "safe" to use bundled rexml gem for Ruby 2.4, 2.5, 2.6 and 2.7.

Background:

If some of Ruby gems which support multiple version of Ruby from 2.4 and Ruby 2.8 (maybe 3), it needs to gemfile to Gemfile or spec.add_runtime_dependency to gemspec files to use rexml for Ruby 2.8.

As far as I know, RubyGems does not have a feature to enable add_runtime_dependency for the specific version of Ruby then all of Ruby versions will use bundled rexml gem.

Question on the next published Gem version after 3.2.8

Hello folks, sorry if this is not the right place for this, but i had a question on when you will be publishing the next version? There is a change / fix in the current master branch we would like to have applied to our code base.

basically wondering if we should spend time porting the fix to a local version of this gem or just wait until the next published version?

thanks!

Error on 3.2.9

I'm getting this error on 3.2.9:

REXML::ParseException - #<TypeError: wrong argument type String (expected Regexp)>
/Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/source.rb:220:in `scan'
/Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/source.rb:220:in `match'
/Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/parsers/baseparser.rb:227:in `pull_event'
/Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/parsers/baseparser.rb:207:in `pull'
/Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/parsers/treeparser.rb:23:in `parse'
/Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/document.rb:448:in `build'
/Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/document.rb:101:in `initialize'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.24.0/lib/xcodeproj/workspace.rb:83:in `new'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.24.0/lib/xcodeproj/workspace.rb:83:in `from_s'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.24.0/lib/xcodeproj/workspace.rb:66:in `new_from_xcworkspace'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/user_project_integrator.rb:102:in `create_workspace'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/user_project_integrator.rb:71:in `integrate!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:929:in `block in integrate_user_project'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:925:in `integrate_user_project'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:185:in `integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:170:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
...
wrong argument type String (expected Regexp)
Line: 1
Position: 38
Last 80 unconsumed characters:
<?xml version="1.0" encoding="UTF-8"?>
/Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/parsers/treeparser.rb:96:in `rescue in parse'
/Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/parsers/treeparser.rb:21:in `parse'
/Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/document.rb:448:in `build'
/Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/document.rb:101:in `initialize'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.24.0/lib/xcodeproj/workspace.rb:83:in `new'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.24.0/lib/xcodeproj/workspace.rb:83:in `from_s'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.24.0/lib/xcodeproj/workspace.rb:66:in `new_from_xcworkspace'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/user_project_integrator.rb:102:in `create_workspace'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/user_project_integrator.rb:71:in `integrate!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:929:in `block in integrate_user_project'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:925:in `integrate_user_project'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:185:in `integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:170:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

The error goes away when using 3.2.6.

rexml/document not installed but rexml/document doesn't exist

Having this issue on Arch Linux, whenever I run cewl I get the following output:

CeWL 5.5.2 (Grouping) Robin Wood ([email protected]) (https://digi.ninja/)

Error: rexml/document gem not installed
	 use: "gem install rexml/document" to install the required gem

If I try to install as per the instructions I get the following output:

$ gem install rexml/document
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    bad response Not Found 404 (https://index.rubygems.org/info/rexml/document)

~/.local/share/gem/ruby/3.0.0/bin is in my PATH

XPath: Node-Set to Boolean

Hi,

I think I found an issue with the XPath evaluation of REXML, as I am currently comparing multiple XPath libraries.

If we pass an XPath expression to REXML which should evaluate a condition on nodes, it evaluates it on every node. While this may seem intuitve, it differs from the XPath 1.0 Standard, as it states there:

If one object to be compared is a node-set and the other is a number, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the number to be compared and on the result of converting the string-value of that node to a number using the number function is true.
(Source: https://www.w3.org/TR/1999/REC-xpath-19991116/ Chapter 3.4 Booleans)

Below is a simple demonstration example tested on ruby 2.6. The output is falsetruetruefalse

require "rexml/document"
include REXML
string = <<EOF
  <?xml version="1.0"?>
  <bookstore>
      <price>123</price>
      <price>456</price>
      <price>789</price>
      <price>234</price>
  </bookstore>
EOF
doc = Document.new string
puts XPath.match( doc, "//price>400")

This is significantly different from the other libraries I investigated:

Testing library: nokogiri , xpath: //price>400
true
Testing library: xqilla , xpath: //price>400
true
Testing library: rexml , xpath: //price>400
falsetruetruefalse
Testing library: xalan-j , xpath: //price>400
true
Testing library: saxon , xpath: //price>400
true
Testing library: jaxen , xpath: //price>400
true
Testing library: lxml , xpath: //price>400
true
Testing library: VTD-Gen , xpath: //price>400
true

Basically I think to fix this, a further evaluation step is needed. Instead of returning the Results of the comparison directly, it should be evaluated if one of the results is true and then just return true.

I hope this helps and best regards,
Mirko

Could you set required_ruby_version >= 2.1? Latest 3.2.5 release is broken on Ruby 2.0

Hello there!

I'm one of the maintainers for @DataDog's ddtrace gem. We still support customers running Ruby 2.0, and run our CI with Ruby 2.0 as well.

We've noticed that the latest 3.2.5 release no longer works on Ruby 2.0. Of course, it doesn't make any sense to ask upstream to still support Ruby 2.0 (good riddance), but I'd like to ask for two things:

  1. Could you add required_ruby_version = '>=2.1' (or some later version) to the gemspec and release a 3.2.6 with that change?
  2. Could you yank version 3.2.5, so that bundler doesn't try to install it on older rubies?

Thanks a lot, and let me know if there's anything I can help with to make this move faster :)

REXML changes quote type

I work with signed XML files and I'm trying to read an XML file with REXML and extract a Node which I then verify against a signature. My problem is, that REXML changes the double quotes to single quotes in the XML. Everything else (such as spaces, etc) is properly kept. Unfortunately, I can not say if an XML comes with single, double, or even mixed quotes. Is there a way to get an unchanged XML from a Node/Element?

REXML gem specifies ruby > 0 but does not support < 2

Since rexml has been moved from a default to a bundled gem in Ruby 3.0, we are working on adding it as an explicit dependency for the aws-sdk-ruby. However, adding it as a dependency breaks in Ruby 1.9.3 (anything < 2) because some of the code uses syntax that is incompatible with 1.9 (example commit where incompatibility was introduced).

Would it be possible to either:

  1. Specify supported ruby versions in the gemspec or
  2. Fix the syntax (use of the double splat) to ensure compatability

XPath White-space and data conversion

Hello again,

We found that REXML (and VTD-XML) behaved differently when we converted a node-set to a number.
This might be fixed by the recent patch, we do not use the git for testing.

We used the following document for testing.

<?xml version="1.0"?>
<bookstore>
    <book-id>123</book-id>
    <book-id>456</book-id>
    <book-id>789</book-id>
    <book-id>234</book-id>
</bookstore>

We executed the XPath expression number(/bookstore) on the libraries leading to the results shown below:

Testing library: nokogiri , xpath: number(/bookstore)
NaN
Testing library: rexml , xpath: number(/bookstore)
123.0
Testing library: xalan-j , xpath: number(/bookstore)
NaN
Testing library: jaxen , xpath: number(/bookstore)
NaN
Testing library: lxml , xpath: number(/bookstore)
nan
Testing library: VTD-XML , xpath: number(/bookstore)
1.23456789234E11

The results of REXML (and VTD) differ significantly from the other outputs.

The relevant portion of the XPath 1.0 standard on how a node-set is converted to a number is the following:

a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument. (Chapter 4.4 Number Functions)

So we could rewrite the XPath expression to number(string(/bookstore)). This leads to the same results as before, which is right.

Important to note here is, that white-space in an XML Document is turned into a text-node children element.
The string value of an element node is defined like this in XPath 1.0:

The string-value of an element node is the concatenation of the string-values of all text node descendants of the element node in document order.[Chapter 5.2 Element Nodes]

So when we execute the XPath expression string(/bookstore) the result should contain with white-space as well. VTD strips the white-space, which is non-standard behavior.

Executing just the string(node-set) function leads to the following results:

lxml, nokogiri, rexml, xalan-j, jaxen, xpath: string(/bookstore)

    123
    456
    789
    234

library: VTD-XML , xpath: string(/bookstore)
123456789234

When VTD-XML now calls the number function with the wrong string value like this number('123456789234'), it results in the wrong final result of 123456789234.

While REXML seems to convert the node correctly into a string, it does not handle the string-to-number conversion right, as it seems to ignore the white-space.

The standard clearly states how a string is converted to a number and how to handle whitespace:

A string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN[Chapter 4.4 Number Functions]

As our result has four numbers divided by white-space, it can not be converted and should result in NaN.
REXML, however, returns the number 123 which is incorrect.

Thank you for your time and we hope this is helpful.

check these possible issues reported by rubocop and by rubocop/require_tools

rubocop -P --only Lint /usr/lib/ruby/2.7.0/rexml/ --except Lint/EmptyWhen,Lint/Loop
Offenses:

/usr/lib/ruby/2.7.0/rexml/attlistdecl.rb:55:20: W: Lint/UnusedMethodArgument: Unused method argument - indent. If it's necessary, use _ or _indent as an argument name to indicate that it won't be used.
    def write out, indent=-1
                   ^^^^^^
/usr/lib/ruby/2.7.0/rexml/attribute.rb:173:7: W: Lint/Void: self used in void context.
      self
      ^^^^
/usr/lib/ruby/2.7.0/rexml/attribute.rb:184:24: W: Lint/UnusedMethodArgument: Unused method argument - indent. If it's necessary, use _ or _indent as an argument name to indicate that it won't be used.
    def write( output, indent=-1 )
                       ^^^^^^
/usr/lib/ruby/2.7.0/rexml/cdata.rb:60:43: W: Lint/UnusedMethodArgument: Unused method argument - transitive. If it's necessary, use _ or _transitive as an argument name to indicate that it won't be used.
    def write( output=$stdout, indent=-1, transitive=false, ie_hack=false )
                                          ^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/cdata.rb:60:61: W: Lint/UnusedMethodArgument: Unused method argument - ie_hack. If it's necessary, use _ or _ie_hack as an argument name to indicate that it won't be used.
    def write( output=$stdout, indent=-1, transitive=false, ie_hack=false )
                                                            ^^^^^^^
/usr/lib/ruby/2.7.0/rexml/child.rb:53:7: W: Lint/ReturnInVoidContext: Do not return a value in parent=.
      return @parent if @parent == other
      ^^^^^^
/usr/lib/ruby/2.7.0/rexml/comment.rb:50:35: W: Lint/UnusedMethodArgument: Unused method argument - transitive. If it's necessary, use _ or _transitive as an argument name to indicate that it won't be used.
    def write( output, indent=-1, transitive=false, ie_hack=false )
                                  ^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/comment.rb:50:53: W: Lint/UnusedMethodArgument: Unused method argument - ie_hack. If it's necessary, use _ or _ie_hack as an argument name to indicate that it won't be used.
    def write( output, indent=-1, transitive=false, ie_hack=false )
                                                    ^^^^^^^
/usr/lib/ruby/2.7.0/rexml/doctype.rb:109:34: W: Lint/UnusedMethodArgument: Unused method argument - transitive. If it's necessary, use _ or _transitive as an argument name to indicate that it won't be used.
    def write( output, indent=0, transitive=false, ie_hack=false )
                                 ^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/doctype.rb:109:52: W: Lint/UnusedMethodArgument: Unused method argument - ie_hack. If it's necessary, use _ or _ie_hack as an argument name to indicate that it won't be used.
    def write( output, indent=0, transitive=false, ie_hack=false )
                                                   ^^^^^^^
/usr/lib/ruby/2.7.0/rexml/doctype.rb:226:24: W: Lint/UnusedMethodArgument: Unused method argument - indent. If it's necessary, use _ or _indent as an argument name to indicate that it won't be used.
    def write( output, indent )
                       ^^^^^^
/usr/lib/ruby/2.7.0/rexml/doctype.rb:231:3: W: Lint/UselessAccessModifier: Useless public access modifier.
  public
  ^^^^^^
/usr/lib/ruby/2.7.0/rexml/doctype.rb:246:24: W: Lint/UnusedMethodArgument: Unused method argument - indent. If it's necessary, use _ or _indent as an argument name to indicate that it won't be used.
    def write( output, indent )
                       ^^^^^^
/usr/lib/ruby/2.7.0/rexml/doctype.rb:276:24: W: Lint/UnusedMethodArgument: Unused method argument - indent. If it's necessary, use _ or _indent as an argument name to indicate that it won't be used.
    def write( output, indent=-1 )
                       ^^^^^^
/usr/lib/ruby/2.7.0/rexml/element.rb:509:7: W: Lint/ReturnInVoidContext: Do not return a value in text=.
      return self
      ^^^^^^
/usr/lib/ruby/2.7.0/rexml/element.rb:748:9: W: Lint/NonLocalExitFromIterator: Non-local exit from iterator, without return value. next, break, Array#find, Array#any?, etc. is preferred.
        return if max>0 and num == max
        ^^^^^^
/usr/lib/ruby/2.7.0/rexml/element.rb:829:7: W: Lint/ReturnInVoidContext: Do not return a value in []=.
      return previous
      ^^^^^^
/usr/lib/ruby/2.7.0/rexml/element.rb:1150:7: W: Lint/ReturnInVoidContext: Do not return a value in []=.
      return @element
      ^^^^^^
/usr/lib/ruby/2.7.0/rexml/encoding.rb:16:7: W: Lint/ReturnInVoidContext: Do not return a value in encoding=.
      return false if defined?(@encoding) and encoding == @encoding
      ^^^^^^
/usr/lib/ruby/2.7.0/rexml/encoding.rb:22:7: W: Lint/Void: Literal true used in void context.
      true
      ^^^^
/usr/lib/ruby/2.7.0/rexml/entity.rb:97:20: W: Lint/UnusedMethodArgument: Unused method argument - indent. If it's necessary, use _ or _indent as an argument name to indicate that it won't be used.
    def write out, indent=-1
                   ^^^^^^
/usr/lib/ruby/2.7.0/rexml/formatters/pretty.rb:124:52: W: Lint/UnusedMethodArgument: Unused method argument - indentfirstline. If it's necessary, use _ or _indentfirstline as an argument name to indicate that it won't be used.
      def indent_text(string, level=1, style="\t", indentfirstline=true)
                                                   ^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/formatters/pretty.rb:131:47: W: Lint/AssignmentInCondition: Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
        while string.length > width and place = string.rindex(' ', width)
                                              ^
/usr/lib/ruby/2.7.0/rexml/functions.rb:269:25: W: Lint/UnusedBlockArgument: Unused block argument - x. You can omit the argument if you don't care about it.
        string.collect{|x| string.to_s.strip.gsub(/\s+/um, ' ') if string}
                        ^
/usr/lib/ruby/2.7.0/rexml/instruction.rb:51:34: W: Lint/UnusedMethodArgument: Unused method argument - transitive. If it's necessary, use _ or _transitive as an argument name to indicate that it won't be used.
    def write writer, indent=-1, transitive=false, ie_hack=false
                                 ^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/instruction.rb:51:52: W: Lint/UnusedMethodArgument: Unused method argument - ie_hack. If it's necessary, use _ or _ie_hack as an argument name to indicate that it won't be used.
    def write writer, indent=-1, transitive=false, ie_hack=false
                                                   ^^^^^^^
/usr/lib/ruby/2.7.0/rexml/light/node.rb:24:11: W: Lint/UselessAssignment: Useless assignment to variable - node.
          node = [ :text, node ]
          ^^^^
/usr/lib/ruby/2.7.0/rexml/light/node.rb:26:11: W: Lint/UselessAssignment: Useless assignment to variable - node.
          node = [ :document, nil, nil ]
          ^^^^
/usr/lib/ruby/2.7.0/rexml/light/node.rb:137:18: W: Lint/UnusedMethodArgument: Unused method argument - foo. If it's necessary, use _ or _foo as an argument name to indicate that it won't be used. You can also write as text=(*) if you want the method to accept any arguments but don't care about them.
      def text=( foo )
                 ^^^
/usr/lib/ruby/2.7.0/rexml/light/node.rb:172:25: W: Lint/UnusedMethodArgument: Unused method argument - node. If it's necessary, use _ or _node as an argument name to indicate that it won't be used.
      def namespace_of( node, prefix=nil )
                        ^^^^
/usr/lib/ruby/2.7.0/rexml/light/node.rb:190:30: W: Lint/UnusedBlockArgument: Unused block argument - k. If it's necessary, use _ or _k as an argument name to indicate that it won't be used.
          ns = at(3).find { |k,v| v == namespace }
                             ^
/usr/lib/ruby/2.7.0/rexml/parsers/baseparser.rb:228:30: W: Lint/UselessAssignment: Useless assignment to variable - curr_ns.
            @nsstack.unshift(curr_ns=Set.new)
                             ^^^^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/baseparser.rb:437:35: W: Lint/UnusedBlockArgument: Unused block argument - key. If it's necessary, use _ or _key as an argument name to indicate that it won't be used.
        DEFAULT_ENTITIES.each do |key, value|
                                  ^^^
/usr/lib/ruby/2.7.0/rexml/parsers/lightparser.rb:25:15: W: Lint/LiteralAsCondition: Literal true appeared as a condition.
        while true
              ^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/sax2parser.rb:87:28: W: Lint/UnusedBlockArgument: Unused block argument - match. If it's necessary, use _ or _match as an argument name to indicate that it won't be used.
        @procs.each { |sym,match,block| block.call if sym == :start_document }
                           ^^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/sax2parser.rb:88:32: W: Lint/UnusedBlockArgument: Unused block argument - match. If it's necessary, use _ or _match as an argument name to indicate that it won't be used.
        @listeners.each { |sym,match,block|
                               ^^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/sax2parser.rb:92:15: W: Lint/LiteralAsCondition: Literal true appeared as a condition.
        while true
              ^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/sax2parser.rb:111:48: W: Lint/UnusedBlockArgument: Unused block argument - value. If it's necessary, use _ or _value as an argument name to indicate that it won't be used.
              nsdecl = event[2].find_all { |n, value| n =~ /^xmlns(:|$)/ }
                                               ^^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/sax2parser.rb:153:53: W: Lint/UnusedBlockArgument: Unused block argument - ns_uri. If it's necessary, use _ or _ns_uri as an argument name to indicate that it won't be used.
              namespace_mapping.each do |ns_prefix, ns_uri|
                                                    ^^^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/sax2parser.rb:174:15: W: Lint/ShadowedArgument: Argument m was shadowed by a local variable before it was used.
              m=$1
              ^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/sax2parser.rb:232:41: W: Lint/UnusedBlockArgument: Unused block argument - block. If it's necessary, use _ or _block as an argument name to indicate that it won't be used.
        @procs.find_all do |sym, match, block|
                                        ^^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/sax2parser.rb:245:45: W: Lint/UnusedBlockArgument: Unused block argument - block. If it's necessary, use _ or _block as an argument name to indicate that it won't be used.
        @listeners.find_all do |sym, match, block|
                                            ^^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/streamparser.rb:19:15: W: Lint/LiteralAsCondition: Literal true appeared as a condition.
        while true
              ^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/treeparser.rb:22:17: W: Lint/LiteralAsCondition: Literal true appeared as a condition.
          while true
                ^^^^
/usr/lib/ruby/2.7.0/rexml/parsers/treeparser.rb:64:34: W: Lint/UnusedBlockArgument: Unused block argument - v. If it's necessary, use _ or _v as an argument name to indicate that it won't be used.
              entities.each { |k,v| entities[k] = @build_context.entities[k].value }
                                 ^
/usr/lib/ruby/2.7.0/rexml/parsers/ultralightparser.rb:24:15: W: Lint/LiteralAsCondition: Literal true appeared as a condition.
        while true
              ^^^^
/usr/lib/ruby/2.7.0/rexml/quickpath.rb:217:7: W: Lint/RescueException: Avoid rescuing the Exception class. Perhaps you meant to rescue StandardError?
      rescue Exception ...
      ^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/source.rb:91:19: W: Lint/UnusedMethodArgument: Unused method argument - char. If it's necessary, use _ or _char as an argument name to indicate that it won't be used.
    def match_to( char, pattern )
                  ^^^^
/usr/lib/ruby/2.7.0/rexml/source.rb:95:27: W: Lint/UnusedMethodArgument: Unused method argument - char. If it's necessary, use _ or _char as an argument name to indicate that it won't be used.
    def match_to_consume( char, pattern )
                          ^^^^
/usr/lib/ruby/2.7.0/rexml/source.rb:163:25: W: Lint/UnusedMethodArgument: Unused method argument - block_size. If it's necessary, use _ or _block_size as an argument name to indicate that it won't be used.
    def initialize(arg, block_size=500, encoding=nil)
                        ^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/source.rb:210:7: W: Lint/RescueException: Avoid rescuing the Exception class. Perhaps you meant to rescue StandardError?
      rescue Exception, NameError ...
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/source.rb:210:7: W: Lint/ShadowedException: Do not shadow rescued Exceptions.
      rescue Exception, NameError ...
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/source.rb:255:9: W: Lint/SuppressedException: Do not suppress exceptions.
        rescue
        ^^^^^^
/usr/lib/ruby/2.7.0/rexml/text.rb:131:37: W: Lint/UnusedMethodArgument: Unused method argument - doctype. If it's necessary, use _ or _doctype as an argument name to indicate that it won't be used.
    def Text.check string, pattern, doctype
                                    ^^^^^^^
/usr/lib/ruby/2.7.0/rexml/text.rb:293:35: W: Lint/UnusedMethodArgument: Unused method argument - transitive. If it's necessary, use _ or _transitive as an argument name to indicate that it won't be used.
    def write( writer, indent=-1, transitive=false, ie_hack=false )
                                  ^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/text.rb:293:53: W: Lint/UnusedMethodArgument: Unused method argument - ie_hack. If it's necessary, use _ or _ie_hack as an argument name to indicate that it won't be used.
    def write( writer, indent=-1, transitive=false, ie_hack=false )
                                                    ^^^^^^^
/usr/lib/ruby/2.7.0/rexml/text.rb:344:5: W: Lint/IneffectiveAccessModifier: private (on line 337) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.
    def Text::read_with_substitution( input, illegal=nil )
    ^^^
/usr/lib/ruby/2.7.0/rexml/text.rb:370:5: W: Lint/IneffectiveAccessModifier: private (on line 337) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.
    def Text::normalize( input, doctype=nil, entity_filter=nil )
    ^^^
/usr/lib/ruby/2.7.0/rexml/text.rb:392:5: W: Lint/IneffectiveAccessModifier: private (on line 337) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.
    def Text::unnormalize( string, doctype=nil, filter=nil, illegal=nil )
    ^^^
/usr/lib/ruby/2.7.0/rexml/text.rb:392:61: W: Lint/UnusedMethodArgument: Unused method argument - illegal. If it's necessary, use _ or _illegal as an argument name to indicate that it won't be used.
    def Text::unnormalize( string, doctype=nil, filter=nil, illegal=nil )
                                                            ^^^^^^^
/usr/lib/ruby/2.7.0/rexml/text.rb:405:5: W: Lint/IneffectiveAccessModifier: private (on line 337) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.
    def Text.expand(ref, doctype, filter)
    ^^^
/usr/lib/ruby/2.7.0/rexml/undefinednamespaceexception.rb:5:29: W: Lint/UnusedMethodArgument: Unused method argument - source. If it's necessary, use _ or _source as an argument name to indicate that it won't be used.
    def initialize( prefix, source, parser )
                            ^^^^^^
/usr/lib/ruby/2.7.0/rexml/undefinednamespaceexception.rb:5:37: W: Lint/UnusedMethodArgument: Unused method argument - parser. If it's necessary, use _ or _parser as an argument name to indicate that it won't be used.
    def initialize( prefix, source, parser )
                                    ^^^^^^
/usr/lib/ruby/2.7.0/rexml/validation/relaxng.rb:182:14: W: Lint/RedundantStringCoercion: Use self instead of Object#to_s in interpolation.
        "< #{to_s} #{@events.collect{|e|
             ^^^^
/usr/lib/ruby/2.7.0/rexml/validation/relaxng.rb:416:14: W: Lint/RedundantStringCoercion: Use self instead of Object#to_s in interpolation.
        "< #{to_s} #{@choices.collect{|e| e.collect{|f|f.to_s}.join(', ')}.join(' or ')} >"
             ^^^^
/usr/lib/ruby/2.7.0/rexml/validation/relaxng.rb:523:14: W: Lint/RedundantStringCoercion: Use self instead of Object#to_s in interpolation.
        "< #{to_s} #{@choices.collect{|e| e.collect{|f|f.to_s}.join(', ')}.join(' and ')} >"
             ^^^^
/usr/lib/ruby/2.7.0/rexml/validation/relaxng.rb:535:13: W: Lint/RedundantStringCoercion: Use self instead of Object#to_s in interpolation.
        "{#{to_s}}"
            ^^^^
/usr/lib/ruby/2.7.0/rexml/xmldecl.rb:49:23: W: Lint/UnusedMethodArgument: Unused method argument - indent. If it's necessary, use _ or _indent as an argument name to indicate that it won't be used.
    def write(writer, indent=-1, transitive=false, ie_hack=false)
                      ^^^^^^
/usr/lib/ruby/2.7.0/rexml/xmldecl.rb:49:34: W: Lint/UnusedMethodArgument: Unused method argument - transitive. If it's necessary, use _ or _transitive as an argument name to indicate that it won't be used.
    def write(writer, indent=-1, transitive=false, ie_hack=false)
                                 ^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/xmldecl.rb:49:52: W: Lint/UnusedMethodArgument: Unused method argument - ie_hack. If it's necessary, use _ or _ie_hack as an argument name to indicate that it won't be used.
    def write(writer, indent=-1, transitive=false, ie_hack=false)
                                                   ^^^^^^^
/usr/lib/ruby/2.7.0/rexml/xpath_parser.rb:97:16: W: Lint/UnusedMethodArgument: Unused method argument - path_stack. If it's necessary, use _ or _path_stack as an argument name to indicate that it won't be used.
    def first( path_stack, node )
               ^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/xpath_parser.rb:562:39: W: Lint/UnusedBlockArgument: Unused block argument - node. You can omit the argument if you don't care about it.
          filter_nodeset(nodeset) do |node|
                                      ^^^^
/usr/lib/ruby/2.7.0/rexml/xpath_parser.rb:660:45: W: Lint/UnusedBlockArgument: Unused block argument - node. If it's necessary, use _ or _node as an argument name to indicate that it won't be used.
      ordered = new_arry.sort_by do |index, node|
                                            ^^^^

49 files inspected, 73 offenses detected


$ rubocop --only Require  --require rubocop/require_tools /usr/lib/ruby/2.7.0/rexml/ -P
Offenses:

/usr/lib/ruby/2.7.0/rexml/dtd/entitydecl.rb:51:28: C: Require/MissingRequireStatement: PATTERN_RE not found, you're probably missing a require statement or there is a cycle in your dependencies.
        md = source.match( PATTERN_RE, true )
                           ^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/dtd/notationdecl.rb:34:28: C: Require/MissingRequireStatement: PATTERN_RE not found, you're probably missing a require statement or there is a cycle in your dependencies.
        md = source.match( PATTERN_RE, true )
                           ^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/source.rb:195:18: C: Require/MissingRequireStatement: Iconv::IllegalSequence not found, you're probably missing a require statement or there is a cycle in your dependencies.
          rescue Iconv::IllegalSequence
                 ^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/ruby/2.7.0/rexml/validation/relaxng.rb:89:25: C: Require/MissingRequireStatement: AnyName not found, you're probably missing a require statement or there is a cycle in your dependencies.
              states << AnyName.new( self )
                        ^^^^^^^

49 files inspected, 4 offenses detected

Potential Typo in `REXML::Functions::normalize_space()` Implementation

Hello Ruby/REXML developers,

The implementation can be found here:

https://github.com/ruby/rexml/blob/7e4049f6a68c99c4efec2df117057ee080680c9f/lib/rexml/functions.rb#L265C1-L273C8

The current code is as follows:

    # UNTESTED
    def Functions::normalize_space( string=nil )
      string = string(@@context[:node]) if string.nil?
      if string.kind_of? Array
        string.collect{|x| string.to_s.strip.gsub(/\s+/um, ' ') if string}
      else
        string.to_s.strip.gsub(/\s+/um, ' ')
      end
    end

It appears there may be a typo in the use of x versus string within the collect block. I believe the following adjustment might be more in line with the intended functionality:

string.collect{|x| x.to_s.strip.gsub(/\s+/um, ' ') if x}

I might be misunderstanding the intention here, so if I've overlooked something, please do let me know.
Thank you for your time.

Slash lost with parent nodes

The following code

require 'rexml'

parsed = REXML::Parsers::XPathParser.new.parse '/a/b/..'
puts "#{parsed}"
puts ""
appreviated = REXML::Parsers::XPathParser.new.abbreviate parsed
puts "#{appreviated}"

outputs

[:document, :child, :qname, "", "a", :child, :qname, "", "b", :parent, :node]

/a/b..

The expected output of abbreviate parsed is /a/b/...

I'm not sure if the problem is with parse, abbreviate, or both.

Same problem with :self node: /a/b/..

CI: 9.3.4.0 JRuby on Windows fails to install Bundler

A recent build ran into this snag:

Installing Bundler
  C:\Windows\system32\cmd.exe /D /S /C "D:\jruby-9.3.4.0\bin\gem.bat install bundler -v "~> 2.0""
  ERROR:  While executing gem ... (Errno::EACCES)
      Permission denied - NUL
  Took  12.25 seconds
Error: Error: The process 'D:\jruby-9.3.4.0\bin\gem.bat' failed with exit code 1

SystemStackError

I'm not sure why this would be new to me... but I'm getting a stack level too deep (SystemStackError) from REXML when running pronto-rubocop, caused by line 79 here: https://github.com/ruby/rexml/blob/master/lib/rexml/xmldecl.rb#L74-L85

I tried adding a breakpoint to be sure and I can see it looping on the self.old_enc = enc line, over and over (since old_enc= is aliased to encoding=). Here's my stacktrace:

	11909: from /Users/pauld/.gem/ruby/2.5.3/bin/pronto:23:in `<main>'
	11908: from /Users/pauld/.gem/ruby/2.5.3/bin/pronto:23:in `load'
	11907: from /Users/pauld/.gem/ruby/2.5.3/gems/pronto-0.10.0/bin/pronto:6:in `<top (required)>'
	11906: from /Users/pauld/.gem/ruby/2.5.3/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
	11905: from /Users/pauld/.gem/ruby/2.5.3/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	11904: from /Users/pauld/.gem/ruby/2.5.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	11903: from /Users/pauld/.gem/ruby/2.5.3/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	11902: from /Users/pauld/.gem/ruby/2.5.3/gems/pronto-0.10.0/lib/pronto/cli.rb:52:in `run'
	 ... 11897 levels...
	    4: from /Users/pauld/.rubies/ruby-2.5.3/lib/ruby/2.5.0/rexml/xmldecl.rb:79:in `encoding='
	    3: from /Users/pauld/.rubies/ruby-2.5.3/lib/ruby/2.5.0/rexml/xmldecl.rb:79:in `encoding='
	    2: from /Users/pauld/.rubies/ruby-2.5.3/lib/ruby/2.5.0/rexml/xmldecl.rb:79:in `encoding='
	    1: from /Users/pauld/.rubies/ruby-2.5.3/lib/ruby/2.5.0/rexml/xmldecl.rb:79:in `encoding='
/Users/pauld/.rubies/ruby-2.5.3/lib/ruby/2.5.0/rexml/xmldecl.rb:75:in `encoding=': stack level too deep (SystemStackError)

For what it's worth, I'm also seeing tons of warnings:

/Users/pauld/.gem/ruby/2.5.3/gems/rexml-3.2.4/lib/rexml/parsers/baseparser.rb:99: warning: already initialized constant REXML::Parsers::BaseParser::ENTITYVALUE
/Users/pauld/.rubies/ruby-2.5.3/lib/ruby/2.5.0/rexml/parsers/baseparser.rb:94: warning: previous definition of ENTITYVALUE was here
/Users/pauld/.gem/ruby/2.5.3/gems/rexml-3.2.4/lib/rexml/parsers/baseparser.rb:100: warning: already initialized constant REXML::Parsers::BaseParser::PEDEF
/Users/pauld/.rubies/ruby-2.5.3/lib/ruby/2.5.0/rexml/parsers/baseparser.rb:95: warning: previous definition of PEDEF was here
/Users/pauld/.gem/ruby/2.5.3/gems/rexml-3.2.4/lib/rexml/parsers/baseparser.rb:101: warning: already initialized constant REXML::Parsers::BaseParser::ENTITYDEF
/Users/pauld/.rubies/ruby-2.5.3/lib/ruby/2.5.0/rexml/parsers/baseparser.rb:96: warning: previous definition of ENTITYDEF was here
/Users/pauld/.gem/ruby/2.5.3/gems/rexml-3.2.4/lib/rexml/parsers/baseparser.rb:102: warning: already initialized constant REXML::Parsers::BaseParser::PEDECL
/Users/pauld/.rubies/ruby-2.5.3/lib/ruby/2.5.0/rexml/parsers/baseparser.rb:97: warning: previous definition of PEDECL was here
/Users/pauld/.gem/ruby/2.5.3/gems/rexml-3.2.4/lib/rexml/parsers/baseparser.rb:103: warning: already initialized constant REXML::Parsers::BaseParser::GEDECL
/Users/pauld/.rubies/ruby-2.5.3/lib/ruby/2.5.0/rexml/parsers/baseparser.rb:98: warning: previous definition of GEDECL was here
/Users/pauld/.gem/ruby/2.5.3/gems/rexml-3.2.4/lib/rexml/parsers/baseparser.rb:104: warning: already initialized constant REXML::Parsers::BaseParser::ENTITYDECL
/Users/pauld/.rubies/ruby-2.5.3/lib/ruby/2.5.0/rexml/parsers/baseparser.rb:99: warning: previous definition of ENTITYDECL was here
/Users/pauld/.gem/ruby/2.5.3/gems/rexml-3.2.4/lib/rexml/parsers/baseparser.rb:106: warning: already initialized constant REXML::Parsers::BaseParser::EREFERENCE
/Users/pauld/.rubies/ruby-2.5.3/lib/ruby/2.5.0/rexml/parsers/baseparser.rb:101: warning: previous definition of EREFERENCE was here
/Users/pauld/.gem/ruby/2.5.3/gems/rexml-3.2.4/lib/rexml/parsers/baseparser.rb:108: warning: already initialized constant REXML::Parsers::BaseParser::DEFAULT_ENTITIES
/Users/pauld/.rubies/ruby-2.5.3/lib/ruby/2.5.0/rexml/parsers/baseparser.rb:103: warning: previous definition of DEFAULT_ENTITIES was here

And on and on for about 276 lines/warnings before the SystemStackError occurs.

Stack level too deep at xmldecl encoding method

Hi there!
I just update my Mac OS X to Monterey and made a fresh install of my project in the development environment.
I'm using rexml as a dependency for rubocop and I've installed ruby 2.6.6 using asdf-vm.

When I try to start a rails console, I get the following error:

/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmltokens.rb:61: warning: already initialized constant REXML::XMLTokens::NAME_START_CHAR
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb:61: warning: previous definition of NAME_START_CHAR was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmltokens.rb:62: warning: already initialized constant REXML::XMLTokens::NAME_CHAR
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb:62: warning: previous definition of NAME_CHAR was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmltokens.rb:63: warning: already initialized constant REXML::XMLTokens::NAMECHAR
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb:63: warning: previous definition of NAMECHAR was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmltokens.rb:73: warning: already initialized constant REXML::XMLTokens::NCNAME_STR
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb:73: warning: previous definition of NCNAME_STR was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmltokens.rb:74: warning: already initialized constant REXML::XMLTokens::NAME_STR
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb:74: warning: previous definition of NAME_STR was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmltokens.rb:76: warning: already initialized constant REXML::XMLTokens::NAME
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb:76: warning: previous definition of NAME was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmltokens.rb:77: warning: already initialized constant REXML::XMLTokens::NMTOKEN
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb:77: warning: previous definition of NMTOKEN was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmltokens.rb:78: warning: already initialized constant REXML::XMLTokens::NMTOKENS
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb:78: warning: previous definition of NMTOKENS was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmltokens.rb:79: warning: already initialized constant REXML::XMLTokens::REFERENCE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb:79: warning: previous definition of REFERENCE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/namespace.rb:13: warning: already initialized constant REXML::Namespace::NAMESPLIT
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/namespace.rb:13: warning: previous definition of NAMESPLIT was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:9: warning: already initialized constant REXML::Entity::PUBIDCHAR
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:9: warning: previous definition of PUBIDCHAR was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:10: warning: already initialized constant REXML::Entity::SYSTEMLITERAL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:10: warning: previous definition of SYSTEMLITERAL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:11: warning: already initialized constant REXML::Entity::PUBIDLITERAL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:11: warning: previous definition of PUBIDLITERAL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:12: warning: already initialized constant REXML::Entity::EXTERNALID
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:12: warning: previous definition of EXTERNALID was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:13: warning: already initialized constant REXML::Entity::NDATADECL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:13: warning: previous definition of NDATADECL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:14: warning: already initialized constant REXML::Entity::PEREFERENCE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:14: warning: previous definition of PEREFERENCE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:15: warning: already initialized constant REXML::Entity::ENTITYVALUE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:15: warning: previous definition of ENTITYVALUE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:16: warning: already initialized constant REXML::Entity::PEDEF
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:16: warning: previous definition of PEDEF was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:17: warning: already initialized constant REXML::Entity::ENTITYDEF
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:17: warning: previous definition of ENTITYDEF was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:18: warning: already initialized constant REXML::Entity::PEDECL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:18: warning: previous definition of PEDECL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:19: warning: already initialized constant REXML::Entity::GEDECL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:19: warning: previous definition of GEDECL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:20: warning: already initialized constant REXML::Entity::ENTITYDECL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:20: warning: previous definition of ENTITYDECL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:125: warning: already initialized constant REXML::Entity::PEREFERENCE_RE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:125: warning: previous definition of PEREFERENCE_RE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:161: warning: already initialized constant REXML::EntityConst::GT
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:161: warning: previous definition of GT was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:163: warning: already initialized constant REXML::EntityConst::LT
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:163: warning: previous definition of LT was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:165: warning: already initialized constant REXML::EntityConst::AMP
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:165: warning: previous definition of AMP was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:167: warning: already initialized constant REXML::EntityConst::QUOT
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:167: warning: previous definition of QUOT was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/entity.rb:169: warning: already initialized constant REXML::EntityConst::APOS
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/entity.rb:169: warning: previous definition of APOS was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/doctype.rb:15: warning: already initialized constant REXML::DocType::START
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/doctype.rb:53: warning: previous definition of START was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/doctype.rb:16: warning: already initialized constant REXML::DocType::STOP
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/doctype.rb:54: warning: previous definition of STOP was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/doctype.rb:17: warning: already initialized constant REXML::DocType::SYSTEM
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/doctype.rb:55: warning: previous definition of SYSTEM was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/doctype.rb:18: warning: already initialized constant REXML::DocType::PUBLIC
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/doctype.rb:56: warning: previous definition of PUBLIC was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/doctype.rb:19: warning: already initialized constant REXML::DocType::DEFAULT_ENTITIES
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/doctype.rb:57: warning: previous definition of DEFAULT_ENTITIES was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/text.rb:14: warning: already initialized constant REXML::Text::SPECIALS
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/text.rb:14: warning: previous definition of SPECIALS was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/text.rb:15: warning: already initialized constant REXML::Text::SUBSTITUTES
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/text.rb:15: warning: previous definition of SUBSTITUTES was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/text.rb:17: warning: already initialized constant REXML::Text::SLAICEPS
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/text.rb:17: warning: previous definition of SLAICEPS was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/text.rb:18: warning: already initialized constant REXML::Text::SETUTITSBUS
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/text.rb:18: warning: previous definition of SETUTITSBUS was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/text.rb:23: warning: already initialized constant REXML::Text::NEEDS_A_SECOND_CHECK
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/text.rb:23: warning: previous definition of NEEDS_A_SECOND_CHECK was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/text.rb:24: warning: already initialized constant REXML::Text::NUMERICENTITY
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/text.rb:24: warning: previous definition of NUMERICENTITY was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/text.rb:25: warning: already initialized constant REXML::Text::VALID_CHAR
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/text.rb:25: warning: previous definition of VALID_CHAR was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/text.rb:33: warning: already initialized constant REXML::Text::VALID_XML_CHARS
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/text.rb:33: warning: previous definition of VALID_XML_CHARS was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/text.rb:214: warning: already initialized constant REXML::Text::REFERENCE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/text.rb:214: warning: previous definition of REFERENCE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/text.rb:368: warning: already initialized constant REXML::Text::EREFERENCE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/text.rb:368: warning: previous definition of EREFERENCE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/attribute.rb:19: warning: already initialized constant REXML::Attribute::PATTERN
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/attribute.rb:19: warning: previous definition of PATTERN was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/attribute.rb:21: warning: already initialized constant REXML::Attribute::NEEDS_A_SECOND_CHECK
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/attribute.rb:21: warning: previous definition of NEEDS_A_SECOND_CHECK was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/cdata.rb:6: warning: already initialized constant REXML::CData::START
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/cdata.rb:6: warning: previous definition of START was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/cdata.rb:7: warning: already initialized constant REXML::CData::STOP
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/cdata.rb:7: warning: previous definition of STOP was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/cdata.rb:8: warning: already initialized constant REXML::CData::ILLEGAL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/cdata.rb:8: warning: previous definition of ILLEGAL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/functions.rb:16: warning: already initialized constant REXML::Functions::INTERNAL_METHODS
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/functions.rb:16: warning: previous definition of INTERNAL_METHODS was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/xpathparser.rb:13: warning: already initialized constant REXML::Parsers::XPathParser::LITERAL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb:13: warning: previous definition of LITERAL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/xpathparser.rb:210: warning: already initialized constant REXML::Parsers::XPathParser::AXIS
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb:216: warning: previous definition of AXIS was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/xpathparser.rb:278: warning: already initialized constant REXML::Parsers::XPathParser::PREFIX_WILDCARD
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb:288: warning: previous definition of PREFIX_WILDCARD was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/xpathparser.rb:279: warning: already initialized constant REXML::Parsers::XPathParser::LOCAL_NAME_WILDCARD
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb:289: warning: previous definition of LOCAL_NAME_WILDCARD was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/xpathparser.rb:280: warning: already initialized constant REXML::Parsers::XPathParser::QNAME
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb:290: warning: previous definition of QNAME was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/xpathparser.rb:281: warning: already initialized constant REXML::Parsers::XPathParser::NODE_TYPE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb:291: warning: previous definition of NODE_TYPE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/xpathparser.rb:282: warning: already initialized constant REXML::Parsers::XPathParser::PI
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb:292: warning: previous definition of PI was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/xpathparser.rb:559: warning: already initialized constant REXML::Parsers::XPathParser::VARIABLE_REFERENCE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb:573: warning: previous definition of VARIABLE_REFERENCE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/xpathparser.rb:560: warning: already initialized constant REXML::Parsers::XPathParser::NUMBER
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb:574: warning: previous definition of NUMBER was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/xpathparser.rb:561: warning: already initialized constant REXML::Parsers::XPathParser::NT
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb:575: warning: previous definition of NT was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xpath_parser.rb:48: warning: already initialized constant REXML::XPathParser::LITERAL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xpath_parser.rb:56: warning: previous definition of LITERAL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xpath.rb:12: warning: already initialized constant REXML::XPath::EMPTY_HASH
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xpath.rb:12: warning: previous definition of EMPTY_HASH was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/element.rb:24: warning: already initialized constant REXML::Element::UNDEFINED
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/element.rb:282: warning: previous definition of UNDEFINED was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmldecl.rb:11: warning: already initialized constant REXML::XMLDecl::DEFAULT_VERSION
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb:11: warning: previous definition of DEFAULT_VERSION was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmldecl.rb:12: warning: already initialized constant REXML::XMLDecl::DEFAULT_ENCODING
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb:12: warning: previous definition of DEFAULT_ENCODING was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmldecl.rb:13: warning: already initialized constant REXML::XMLDecl::DEFAULT_STANDALONE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb:13: warning: previous definition of DEFAULT_STANDALONE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmldecl.rb:14: warning: already initialized constant REXML::XMLDecl::START
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb:14: warning: previous definition of START was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmldecl.rb:15: warning: already initialized constant REXML::XMLDecl::STOP
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb:15: warning: previous definition of STOP was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/comment.rb:9: warning: already initialized constant REXML::Comment::START
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/comment.rb:9: warning: previous definition of START was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/comment.rb:10: warning: already initialized constant REXML::Comment::STOP
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/comment.rb:10: warning: previous definition of STOP was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/instruction.rb:10: warning: already initialized constant REXML::Instruction::START
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/instruction.rb:10: warning: previous definition of START was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/instruction.rb:11: warning: already initialized constant REXML::Instruction::STOP
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/instruction.rb:11: warning: previous definition of STOP was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/rexml.rb:25: warning: already initialized constant REXML::COPYRIGHT
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/rexml.rb:30: warning: previous definition of COPYRIGHT was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/rexml.rb:26: warning: already initialized constant REXML::DATE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/rexml.rb:31: warning: previous definition of DATE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/rexml.rb:27: warning: already initialized constant REXML::VERSION
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/rexml.rb:32: warning: previous definition of VERSION was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/rexml.rb:28: warning: already initialized constant REXML::REVISION
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/rexml.rb:33: warning: previous definition of REVISION was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/rexml.rb:30: warning: already initialized constant REXML::Copyright
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/rexml.rb:35: warning: previous definition of Copyright was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/rexml.rb:31: warning: already initialized constant REXML::Version
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/rexml.rb:36: warning: previous definition of Version was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:30: warning: already initialized constant REXML::Parsers::BaseParser::LETTER
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:30: warning: previous definition of LETTER was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:31: warning: already initialized constant REXML::Parsers::BaseParser::DIGIT
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:31: warning: previous definition of DIGIT was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:33: warning: already initialized constant REXML::Parsers::BaseParser::COMBININGCHAR
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:33: warning: previous definition of COMBININGCHAR was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:34: warning: already initialized constant REXML::Parsers::BaseParser::EXTENDER
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:34: warning: previous definition of EXTENDER was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:36: warning: already initialized constant REXML::Parsers::BaseParser::NCNAME_STR
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:36: warning: previous definition of NCNAME_STR was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:37: warning: already initialized constant REXML::Parsers::BaseParser::QNAME_STR
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:37: warning: previous definition of QNAME_STR was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:38: warning: already initialized constant REXML::Parsers::BaseParser::QNAME
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:38: warning: previous definition of QNAME was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:42: warning: already initialized constant REXML::Parsers::BaseParser::UNAME_STR
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:42: warning: previous definition of UNAME_STR was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:44: warning: already initialized constant REXML::Parsers::BaseParser::NAMECHAR
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:44: warning: previous definition of NAMECHAR was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:45: warning: already initialized constant REXML::Parsers::BaseParser::NAME
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:45: warning: previous definition of NAME was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:46: warning: already initialized constant REXML::Parsers::BaseParser::NMTOKEN
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:46: warning: previous definition of NMTOKEN was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:47: warning: already initialized constant REXML::Parsers::BaseParser::NMTOKENS
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:47: warning: previous definition of NMTOKENS was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:48: warning: already initialized constant REXML::Parsers::BaseParser::REFERENCE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:48: warning: previous definition of REFERENCE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:49: warning: already initialized constant REXML::Parsers::BaseParser::REFERENCE_RE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:49: warning: previous definition of REFERENCE_RE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:51: warning: already initialized constant REXML::Parsers::BaseParser::DOCTYPE_START
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:51: warning: previous definition of DOCTYPE_START was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:52: warning: already initialized constant REXML::Parsers::BaseParser::DOCTYPE_END
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:52: warning: previous definition of DOCTYPE_END was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:54: warning: already initialized constant REXML::Parsers::BaseParser::ATTRIBUTE_PATTERN
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:53: warning: previous definition of ATTRIBUTE_PATTERN was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:55: warning: already initialized constant REXML::Parsers::BaseParser::COMMENT_START
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:54: warning: previous definition of COMMENT_START was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:56: warning: already initialized constant REXML::Parsers::BaseParser::COMMENT_PATTERN
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:55: warning: previous definition of COMMENT_PATTERN was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:57: warning: already initialized constant REXML::Parsers::BaseParser::CDATA_START
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:56: warning: previous definition of CDATA_START was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:58: warning: already initialized constant REXML::Parsers::BaseParser::CDATA_END
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:57: warning: previous definition of CDATA_END was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:59: warning: already initialized constant REXML::Parsers::BaseParser::CDATA_PATTERN
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:58: warning: previous definition of CDATA_PATTERN was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:60: warning: already initialized constant REXML::Parsers::BaseParser::XMLDECL_START
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:59: warning: previous definition of XMLDECL_START was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:61: warning: already initialized constant REXML::Parsers::BaseParser::XMLDECL_PATTERN
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:60: warning: previous definition of XMLDECL_PATTERN was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:62: warning: already initialized constant REXML::Parsers::BaseParser::INSTRUCTION_START
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:61: warning: previous definition of INSTRUCTION_START was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:63: warning: already initialized constant REXML::Parsers::BaseParser::INSTRUCTION_PATTERN
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:62: warning: previous definition of INSTRUCTION_PATTERN was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:64: warning: already initialized constant REXML::Parsers::BaseParser::TAG_MATCH
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:63: warning: previous definition of TAG_MATCH was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:65: warning: already initialized constant REXML::Parsers::BaseParser::CLOSE_MATCH
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:64: warning: previous definition of CLOSE_MATCH was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:67: warning: already initialized constant REXML::Parsers::BaseParser::VERSION
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:66: warning: previous definition of VERSION was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:68: warning: already initialized constant REXML::Parsers::BaseParser::ENCODING
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:67: warning: previous definition of ENCODING was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:69: warning: already initialized constant REXML::Parsers::BaseParser::STANDALONE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:68: warning: previous definition of STANDALONE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:71: warning: already initialized constant REXML::Parsers::BaseParser::ENTITY_START
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:70: warning: previous definition of ENTITY_START was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:73: warning: already initialized constant REXML::Parsers::BaseParser::ELEMENTDECL_START
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:71: warning: previous definition of ELEMENTDECL_START was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:74: warning: already initialized constant REXML::Parsers::BaseParser::ELEMENTDECL_PATTERN
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:72: warning: previous definition of ELEMENTDECL_PATTERN was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:75: warning: already initialized constant REXML::Parsers::BaseParser::SYSTEMENTITY
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:73: warning: previous definition of SYSTEMENTITY was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:76: warning: already initialized constant REXML::Parsers::BaseParser::ENUMERATION
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:74: warning: previous definition of ENUMERATION was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:77: warning: already initialized constant REXML::Parsers::BaseParser::NOTATIONTYPE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:75: warning: previous definition of NOTATIONTYPE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:78: warning: already initialized constant REXML::Parsers::BaseParser::ENUMERATEDTYPE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:76: warning: previous definition of ENUMERATEDTYPE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:79: warning: already initialized constant REXML::Parsers::BaseParser::ATTTYPE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:77: warning: previous definition of ATTTYPE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:80: warning: already initialized constant REXML::Parsers::BaseParser::ATTVALUE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:78: warning: previous definition of ATTVALUE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:81: warning: already initialized constant REXML::Parsers::BaseParser::DEFAULTDECL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:79: warning: previous definition of DEFAULTDECL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:82: warning: already initialized constant REXML::Parsers::BaseParser::ATTDEF
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:80: warning: previous definition of ATTDEF was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:83: warning: already initialized constant REXML::Parsers::BaseParser::ATTDEF_RE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:81: warning: previous definition of ATTDEF_RE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:84: warning: already initialized constant REXML::Parsers::BaseParser::ATTLISTDECL_START
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:82: warning: previous definition of ATTLISTDECL_START was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:85: warning: already initialized constant REXML::Parsers::BaseParser::ATTLISTDECL_PATTERN
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:83: warning: previous definition of ATTLISTDECL_PATTERN was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:86: warning: already initialized constant REXML::Parsers::BaseParser::NOTATIONDECL_START
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:101: warning: previous definition of NOTATIONDECL_START was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:90: warning: already initialized constant REXML::Parsers::BaseParser::TEXT_PATTERN
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:85: warning: previous definition of TEXT_PATTERN was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:93: warning: already initialized constant REXML::Parsers::BaseParser::PUBIDCHAR
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:88: warning: previous definition of PUBIDCHAR was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:94: warning: already initialized constant REXML::Parsers::BaseParser::SYSTEMLITERAL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:89: warning: previous definition of SYSTEMLITERAL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:95: warning: already initialized constant REXML::Parsers::BaseParser::PUBIDLITERAL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:90: warning: previous definition of PUBIDLITERAL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:96: warning: already initialized constant REXML::Parsers::BaseParser::EXTERNALID
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:91: warning: previous definition of EXTERNALID was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:97: warning: already initialized constant REXML::Parsers::BaseParser::NDATADECL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:92: warning: previous definition of NDATADECL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:98: warning: already initialized constant REXML::Parsers::BaseParser::PEREFERENCE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:93: warning: previous definition of PEREFERENCE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:99: warning: already initialized constant REXML::Parsers::BaseParser::ENTITYVALUE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:94: warning: previous definition of ENTITYVALUE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:100: warning: already initialized constant REXML::Parsers::BaseParser::PEDEF
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:95: warning: previous definition of PEDEF was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:101: warning: already initialized constant REXML::Parsers::BaseParser::ENTITYDEF
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:96: warning: previous definition of ENTITYDEF was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:102: warning: already initialized constant REXML::Parsers::BaseParser::PEDECL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:97: warning: previous definition of PEDECL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:103: warning: already initialized constant REXML::Parsers::BaseParser::GEDECL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:98: warning: previous definition of GEDECL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:104: warning: already initialized constant REXML::Parsers::BaseParser::ENTITYDECL
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:99: warning: previous definition of ENTITYDECL was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:106: warning: already initialized constant REXML::Parsers::BaseParser::EREFERENCE
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:106: warning: previous definition of EREFERENCE was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/parsers/baseparser.rb:108: warning: already initialized constant REXML::Parsers::BaseParser::DEFAULT_ENTITIES
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:108: warning: previous definition of DEFAULT_ENTITIES was here
/Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb:77:in `encoding=': stack level too deep (SystemStackError)
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb:81:in `encoding='

...

	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb:81:in `encoding='
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmldecl.rb:77:in `encoding='
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmldecl.rb:32:in `initialize'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmldecl.rb:92:in `new'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/xmldecl.rb:92:in `default'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/document.rb:27:in `<class:Document>'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/document.rb:22:in `<module:REXML>'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rexml/document.rb:16:in `<main>'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:324:in `block in require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:291:in `load_dependency'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:324:in `require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-0.81.0/lib/rubocop/formatter/junit_formatter.rb:3:in `<main>'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:324:in `block in require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:291:in `load_dependency'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:324:in `require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `require_relative'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-0.81.0/lib/rubocop.rb:594:in `<main>'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/bundler/runtime.rb:81:in `block (2 levels) in require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/bundler/runtime.rb:76:in `each'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/bundler/runtime.rb:76:in `block in require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/bundler/runtime.rb:65:in `each'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/bundler/runtime.rb:65:in `require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/bundler.rb:114:in `require'
	from /Users/lupi/web/config/application.rb:19:in `<top (required)>'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	from /Users/lupi/.asdf/installs/ruby/2.6.6/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

Is somebody else getting this error? Could you give me guidance to fix it?

Thanks in advance!

BUG: REXML accepts unclosed DOCTYPE

Currently, REXML accepts unclosed DOCTYPE declarations.

require "rexml/document"

REXML::Document.new("<!DOCTYPE foo [")
# => <UNDEFINED> ... </>
# No exceptions are raised!

It seems strange and it should be fixed.

ParseException on ruby 2.6 and 2.7

ruby 2.5.0

REXML::Document.new('<user></user>')  #=> <UNDEFINED> ... </>

ruby 2.6.3

REXML::Document.new('<user></user>')
=> REXML::ParseException: Invalid attribute name: <</user>
Line: 1
Position: 13
Last 80 unconsumed characters:

gem version does not affect this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.