1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/rexml
kou 4d15e619eb rexml: Fix XPath bug of /#{ELEMENT_NAME}
It doesn't mean that all elements which name "ELEMENT_NAME" with any
namespace URI including null namespace URI. It means that all elements
which name "ELEMENT_NAME" with null namespace URI.

https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-NodeTest

> if the QName does not have a prefix, then the namespace URI is null
> (this is the same way attribute names are expanded).

We need to use "*[local-name()='#{ELEMENT_NAME}']" for all elements
which name "ELEMENT_NAME" with any namespace URI including null
namespace URI in XPath 1.0. But it's inconvenient. So this change
includes "*:#{LOCAL_NAME}" syntax support that is introduced since
XPath 2.0.

* lib/rexml/parsers/xpathparser.rb: Support "*:#{LOCAL_NAME}" syntax that
  is introduced since XPath 2.0.

* lib/rexml/xpath_parser.rb:
  * Fix namespace URI processing for "#{ELEMENT_NAME}". Now,
    "#{ELEMENT_NAME}" doesn't accept elements with null namespace URI.
  * Add "*:#{LOCAL_NAME}" support.

* test/rexml/test_contrib.rb,
  test/rexml/test_core.rb,
  test/rexml/xpath/test_base.rb: Follow this change.

* test/rexml/test_jaxen.rb: Fix namespace processing.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 08:09:04 +00:00
..
data
parse
parser
xpath rexml: Fix XPath bug of /#{ELEMENT_NAME} 2018-04-22 08:09:04 +00:00
listener.rb
rexml_test_utils.rb
test_attributes.rb
test_attributes_mixin.rb
test_changing_encoding.rb
test_comment.rb
test_contrib.rb rexml: Fix XPath bug of /#{ELEMENT_NAME} 2018-04-22 08:09:04 +00:00
test_core.rb rexml: Fix XPath bug of /#{ELEMENT_NAME} 2018-04-22 08:09:04 +00:00
test_doctype.rb
test_document.rb
test_element.rb
test_elements.rb
test_encoding.rb
test_entity.rb
test_functions.rb REXML: Fix a bug that unexpected methods can be called as a XPath function 2017-08-13 12:14:24 +00:00
test_functions_number.rb
test_jaxen.rb rexml: Fix XPath bug of /#{ELEMENT_NAME} 2018-04-22 08:09:04 +00:00
test_light.rb
test_lightparser.rb
test_listener.rb
test_martin_fowler.rb Rename test classes to allow stable test count when running test-all -j 2018-03-13 06:29:02 +00:00
test_namespace.rb
test_order.rb
test_preceding_sibling.rb
test_pullparser.rb
test_rexml_issuezilla.rb
test_sax.rb
test_stream.rb
test_text.rb
test_ticket_80.rb
test_validation_rng.rb
test_xml_declaration.rb