Repository navigation
Incompatible changes
-
Dropped support for Ruby 2.5 (Ruby 2.6 or later is now required)
-
Removed unused
REXML::QuickPath(rexml/quickpath) -
Changed
REXML::Functionsto aREXML::FunctionsClassinstance for thread safety and removed unusedREXML::Functions.text,.processing_instruction,.variables, and.namespace_context -
Switched available XPath function checks from a denylist to an allowlist
- Monkey-patching custom XPath functions onto
REXML::Functionsis no longer supported - GH-369
- Patch by tomoya ishida, Sutou Kouhei
- Monkey-patching custom XPath functions onto
-
Stopped falling back to
XPath.matchfor unregistered XPath functions inFunctionsClass#send(now returns[])- GH-364
- Patch by tomoya ishida
-
Changed XPath to always return node-sets in document order
-
Stopped matching prefixed attributes by their local name only
Attributes#[],#get_attribute, andElement#attributeno longer returnx:bfor"b"; use the qualified name ("x:b") or a namespaceAttributes#keysnow returns qualified names (e.g."xmlns:x","x:b")- GH-335
- Patch by tomoya ishida
-
Validated XPath variable values and fixed
id()return value -
Removed non-working XPath
namespace::axis handling- Emits a warning and returns
[]instead of raisingNoMethodError - GH-323
- Patch by tomoya ishida
- Emits a warning and returns
-
Changed XPath
modoperator to use truncating remainder (Numeric#remainder) and returnNaNformod 0 -
Returned
Infinity/NaNfrom XPathstring(),floor(), andceiling()instead of raisingFloatDomainError- GH-374
- Patch by KBS
Improvements
-
Improved performance
-
Made REXML Ractor-compatible
- GH-344
- Patch by John Hawthorn
-
Deprecated unused
REXML::Text.read_with_substitution(useREXML::Text.unnormalizeinstead)- GH-363
- Patch by Sutou Kouhei
-
Supported parenthesized XPath expressions and
abbreviateof parentheses -
Supported
string-length()XPath function without an argument- GH-337
- Patch by Sai Asish Y
-
Accepted processing instructions in the internal DTD subset
- GH-377
- Patch by Wleeaf
-
Accepted non-ASCII names, combining characters, and extenders in DOCTYPE, processing instructions, DTD declarations, elements, and attributes
-
Accepted any XML whitespace around XPath operators
and,or,div, andmod- GH-399
- Patch by Moksh Upadhyay
-
Rejected underscored XPath function names (e.g.
local_name()) in strict mode (default mode keeps the alias for backward compatibility) -
Improved documentation
Fixes
-
Fixed an issue when executing
REXML::Parsers::SAX2Parser#parsewithout specifying#listen- GH-302
- Patch by NAITOH Jun
-
Fixed infinite entity expansion by detecting circular references
- Circular entity references now raise
REXML::ParseExceptioninstead ofSystemStackError - GH-312
- Patch by NAITOH Jun
- Circular entity references now raise
-
Fixed parsing XPath expressions with string literals containing parentheses and brackets
- GH-318
- Patch by tomoya ishida
-
Fixed XPath
normalize-space()function- GH-324
- Patch by tomoya ishida
-
Fixed XPath functions not to return a primitive value wrapped in an array
- GH-326
- Patch by tomoya ishida
-
Fixed XPath
selfaxis nodeset position- GH-336
- Patch by tomoya ishida
-
Fixed
XMLDeclbeing included in XPathdescendant::node()results -
Fixed XPath name functions (
name(),local-name(),namespace-uri())- Uses the first node in document order without skipping unnamed nodes (e.g.
name(root/node())returns""instead of"node"when a text node comes first) - GH-343
- Patch by tomoya ishida, NAITOH Jun
- Uses the first node in document order without skipping unnamed nodes (e.g.
-
Fixed
substring-after()XPath function not to use Regexp match- GH-355
- Patch by Vít Ondruch
-
Fixed
REXML::Element#attributewhen a namespace URI has multiple bindings -
Avoided stack exhaustion in
REXML::Formatters::Default#write_elementfor deeply nested documents -
Explicitly required
"set"inxpath_parser.rb- GH-361
- Patch by tomoya ishida
-
Stopped substituting entities with an empty value
- Entities declared with an empty value are no longer inserted between every character during text/attribute normalization
- GH-370
- Patch by NAITOH Jun
-
Fixed
REXML::Formatters::Prettymutating text nodes while pretty printing- GH-371
- Patch by KBS
-
Rejected invalid character references in entity expansion
- Invalid XML character references inside entity values now raise
REXML::ParseException - GH-372
- Patch by Sutou Kouhei
- Invalid XML character references inside entity values now raise
-
Fixed XPath
lang()not to match a language prefix that is not a sublanguage- GH-373
- Patch by KBS
-
Fixed RELAX NG validation of documents with XML declarations
-
Fixed XPath
substring()with a start before the first character andround()for negative halves- e.g.
substring('12345', 0)now returns"12345"instead of"1234", andround(-2.5)returns-2instead of-3 - GH-382
- Patch by bardrop
- e.g.
-
Fixed XPath comparisons between a node-set and a boolean, number, or string
- Fixes reversed relational operators when the node-set is on the right (e.g.
10 > @price), boolean comparisons, and string comparisons - GH-383
- Patch by bardrop
- Fixes reversed relational operators when the node-set is on the right (e.g.
-
Preserved whitespace before word operators after XPath predicates
-
Fixed XPath unary minus parsing with leading or separating spaces
- Unary minus without an operand (e.g.
"-"," - - ") now raisesREXML::ParseException - GH-393
- Patch by NAITOH Jun
- Unary minus without an operand (e.g.
-
Renamed the XPath test fixture
xp.tsttoxp.txt- GH-394
- Patch by botamochi0x12
-
Formatted small floats without scientific notation in XPath
string()- e.g.
string(0.00001)now returns"0.00001"instead of"1.0e-05" - GH-395
- Patch by Moksh Upadhyay
- e.g.
-
Fixed XPath parsing of expressions and literals containing line breaks
- GH-397
- Patch by Moksh Upadhyay
-
Fixed XPath matching for the predefined
xmlnamespace and empty strings
Thanks
-
NAITOH Jun
-
Sutou Kouhei
-
tomoya ishida
-
Burdette Lamar
-
John Hawthorn
-
Sai Asish Y
-
Vít Ondruch
-
JinHyuk Sung
-
KBS
-
Wleeaf
-
FFspiky
-
Sourya Singh
-
Gal Be
-
bardrop
-
Moksh Upadhyay
-
Akshay Kumar Sharma
-
botamochi0x12
-
Hiroya Fujinami
-
Brian
-
pboling
-
gemmaro
-
Dickson Wu