From a878af55a71480b05646adf9491851c1f439b82d Mon Sep 17 00:00:00 2001 From: tompng Date: Sat, 6 Jun 2026 04:13:25 +0900 Subject: [PATCH] Remove unused xpath function text() Functions must return nodeset or a primitive value. Functions::text() returning an array of string is a bug to be fixed. Although, `text()` in xpath is resolved as `[:child, :text]`, it's not a function, so Functions::text is unused. --- lib/rexml/functions.rb | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb index 60ae34e7..dcd72ba3 100644 --- a/lib/rexml/functions.rb +++ b/lib/rexml/functions.rb @@ -37,16 +37,6 @@ def Functions::variables ; @@variables ; end def Functions::context=(value); @@context = value; end - def Functions::text( ) - if @@context[:node].node_type == :element - @@context[:node].find_all{|n| n.node_type == :text}.collect{|n| n.value} - elsif @@context[:node].node_type == :text - @@context[:node].value - else - false - end - end - # Returns the last node of the given list of nodes. def Functions::last( ) @@context[:size]