Weird return type of XPath.match and XPath.first
還沒有人認領這個 Issue。
評估
研究方向
從進入點 REXML::XPath.match 和 REXML::XPath.first 開始,閱讀從 ruby/rexml#342 連結的討論。比較它們對這裡所示非節點集運算式的處理方式,然後根據關於 XPath 純量結果的文件或現有預期驗證其行為。
由索引模型根據 Issue 內容生成。
描述
XPath.match always returns an array, even if the evaluated value is not a nodeset.
REXML::XPath.match(REXML::Document.new, '1 + 2') #=> [3]
Nokogiri::XML.parse('<root/>').xpath('1+2') #=> 3
XPath.first returns non-nodeset value. first of non-nodeset value doesn't make sense.
ref: https://github.com/ruby/rexml/pull/342#discussion_r3670807519
REXML::XPath.first(REXML::Document.new, '1 + 2') #=> 3
- 主要語言
- Ruby
- 星號
- 181
- 分支
- 104
- 平均合併
- 11 小時 3 分鐘
- 30 天內合併 PR
- 1
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
ruby/rexml 的其他 Issue
-
XPath underscored function name is wrongly accepted可能已有人在做 @sjh9714 於 46 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 55/100
-
難度 3/5 1-2 天 新手友好度 55/100
-
難度 4/5 3-5 天 新手友好度 48/100
-
難度 5/5 一週以上 新手友好度 35/100
-
RELAX NG Validator fails to handle XML documents with XML declaration可能已有人在做 @Shaisolaris 於 3 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 35/100
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
GantMan/jail-monkey#380 ·
-
難度 2/5 1-3 小時 新手友好度 62/100
voxpupuli/puppet-wireguard#151 ·
-
bug
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
Search accepts any value for `requests_per_page` and `per_page`可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉bug f:search
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆