It breaks backward compatibility than I thought. So it's disabled by
default. It means that REXML's XPath processor isn't compatible with
XPath 1.0. But it will be acceptable for users.
We can enable it by specifying "strict: true" to
REXML::XPathParser.new explicitly.
* lib/rexml/xpath.rb,
lib/rexml/xpath_parser.rb: Accept "strict: true" option.
* test/rexml/test_contrib.rb,
test/rexml/xpath/test_base.rb: Use not XPath 1.0 compatible behavior.
* test/rexml/test_jaxen.rb: Use XPath 1.0 compatible behavior.
* test/rss/test_1.0.rb,
test/rss/test_dublincore.rb,
spec/ruby/library/rexml/element/namespace_spec.rb,
spec/ruby/library/rexml/element/namespaces_spec.rb,
spec/ruby/library/rexml/element/prefixes_spec.rb: Enable again.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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
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
test/rexml/test_jaxen.rb: Fix wrong assert_raise usage. Note that this code
isn't used yet.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/rexml/xpath/test_base.rb: Use here document for readability.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
lib/rexml/parsers/xpathparser.rb: Ignore white spaces in relative
location path.
test/rexml/xpath/test_base.rb: Add more test patterns and use more
debug friendly assertion style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/rexml/xpath/test_base.rb: Use constant value for the expected value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/rexml/xpath/test_base.rb: Expand loop assertion and stop to checking
just the first value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/rexml/xpath/test_base.rb: Stop to use separated assertions for
checking array value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[Bug #14600]
* lib/rexml/xpath_parser.rb: Fix a bug that "/child::node()" returns
XML declaration and text nodes out of root element.
* test/rexml/test_jaxen.rb: Enable more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[Bug #14600]
* lib/rexml/functions.rb: Fix a bug that "@attribute/parent" doesn't
return element of its attribute.
* test/rexml/test_jaxen.rb: Enable more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[Bug #14600]
* lib/rexml/functions.rb: Fix a bug that "name(node-set)" returns
element instead of element name.
* test/rexml/test_jaxen.rb: Enable more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[Bug #14600]
Reported by MSP-Greg. Thanks!!!
* lib/rexml/xpath_parser.rb: Fix a bug that "following_siblings::*[N]"
doesn't work.
* test/rexml/test_jaxen.rb: Enable only axis test for now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
When you change this to true, you may need to add more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(REXMLTests::TestDocument::EntityExpansionLimitTest):
Group tests by general entity and parameter entity.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(REXMLTests::TestDocument::EntityExpansionLimitTest): Define
test XML in each test method because (1) each XML in used only
one test and (2) related data and code should be close.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(REXMLTests::TestDocument::EntityExpansionLimitTest):
Use one test method for one test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(REXMLTests::TestDocument::EntityExpansionLimitTest): Use
setup and teardown instead of ensure in test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Fix wrong parent class. It doesn't need inherit tests in
TestDocument class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
reported by Tomas Hoger <thoger@redhat.com> and patched by nahi.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
reported by Willis Vandevanter <will@silentrobots.com> and
patched by nahi.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
bug that can't parse XML correctly when
Encoding.default_internal is different with XML
encoding. REXML::Source converts XML encoding on read. So IO
should not convert XML encoding.
Based on patch by NAKAMURA Usaku.
[ruby-dev:48686] [Bug #10418]
* test/rexml/test_encoding.rb
(REXMLTests::EncodingTester#test_parse_utf16_with_utf8_default_internal):
Add the for the above case.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(REXMLTests::EncodingTester#test_parse_utf16): Use meaningful
test name. "ticket" in the old test name means the ticket in
REXML's issue tracker. The REXML's issue tracker was gone. So
"ticket" is meaningless.
* test/rexml/data/ticket_110_utf16.xml: Rename to ...
* test/rexml/data/utf16.xml: ... this.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(REXMLTests::EncodingTester#test_ticket_110): Fix expected and
actual order.
Patch by NAKAMURA Usaku. Thanks!!!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
I avoid using the same module for library in test because
it provides "include REXML" environment in test. Normally,
users don't use REXML on "include REXML" environment. So I
don't want to write tests on "include REXML" environment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e