summaryrefslogtreecommitdiff
path: root/test/rexml/xpath
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-22 08:09:04 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-22 08:09:04 +0000
commit4d15e619eb1838daafd1510e86c1c8076fb9b227 (patch)
tree52009b7046146ad093bcd91db9b7b22f7e38bb0b /test/rexml/xpath
parentb252d8ada355ab729a545274e107d3f082f1fde6 (diff)
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
Diffstat (limited to 'test/rexml/xpath')
-rw-r--r--test/rexml/xpath/test_base.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/rexml/xpath/test_base.rb b/test/rexml/xpath/test_base.rb
index 5e0b4770813..497bd9fc8f2 100644
--- a/test/rexml/xpath/test_base.rb
+++ b/test/rexml/xpath/test_base.rb
@@ -877,6 +877,7 @@ module REXMLTests
<tag1 xmlns='ns1'>
<tag2 xmlns='ns2'/>
<tada>xa</tada>
+ <tada xmlns=''>xb</tada>
</tag1>
XML
x = d.root