1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib/rexml
kou 7a6f34103d rexml: Fix XPath bug of //#{ELEMENT_NAME}[#{POSITION}]
The position should be counted for each nodeset but the previous
implementation counts position for union-ed nodeset.

For example, "/a/*/*[1]" should be matched to "<c1/>" and "<c2/>" with
the following XML.

    <a>
      <b>
        <c1/>
      </b>
      <b>
        <c2/>
      </b>
    </a>

But the previous implementation just returns only "<c1/>".

* lib/rexml/element.rb (REXML::Attributes#each_attribute):
  Support Enumerator for no block use.

* lib/rexml/element.rb (REXML::Attributes#each):
  Support Enumerator for no block use.

* lib/rexml/functions.rb (REXML::Functions.string):
  Support NaN again.

* lib/rexml/xpath_parser.rb: Re-implement "Step" evaluator.
  It should evaluate "AxisSpecifier", "NodeTest" and "Predicate" in one
  step to respect position for each nodeset.

* test/rexml/test_jaxen.rb: Enable more tests. Remained tests should
  be also enabled but it'll not be near future.

* test/rexml/xpath/test_base.rb: Fix expected value.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 09:38:06 +00:00
..
dtd
formatters fix documentation of REXML::Formatters::Default (id_hack -> ie_hack) [ci skip] 2017-08-14 16:04:35 +00:00
light
parsers rexml: Fix XPath bug of /#{ELEMENT_NAME} 2018-04-22 08:09:04 +00:00
validation
attlistdecl.rb
attribute.rb
cdata.rb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
child.rb
comment.rb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
doctype.rb
document.rb
element.rb rexml: Fix XPath bug of //#{ELEMENT_NAME}[#{POSITION}] 2018-04-22 09:38:06 +00:00
encoding.rb
entity.rb rexml: improve docs 2017-11-02 20:06:38 +00:00
functions.rb rexml: Fix XPath bug of //#{ELEMENT_NAME}[#{POSITION}] 2018-04-22 09:38:06 +00:00
instruction.rb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
namespace.rb
node.rb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
output.rb
parent.rb
parseexception.rb
quickpath.rb
rexml.rb
sax2listener.rb
security.rb
source.rb
streamlistener.rb
syncenumerator.rb
text.rb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
undefinednamespaceexception.rb
xmldecl.rb
xmltokens.rb
xpath.rb
xpath_parser.rb rexml: Fix XPath bug of //#{ELEMENT_NAME}[#{POSITION}] 2018-04-22 09:38:06 +00:00