Implement XML::LibXML::Element->appendTextNode
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
從 src/main/perl/lib/XML/LibXML.pm 開始,XML::LibXML::Element 介面就在那裡定義;將其與那裡已經實作的相鄰 text/child 方法進行比較,以了解節點是如何表示的。仿照系統 XML::LibXML 的 appendTextNode 語意,然後新增一個有針對性的測試(包括 XML::LibXML::Ferry::create 路徑),並在 Perl、JVM 和直譯器後端下執行它。完成意味著探針的 can("appendTextNode") 為 true,且來自 Ferry v0.8.5 的 t/ferry-write.t 會執行全部 22 個測試直至完成。
由索引模型根據 Issue 內容生成。
描述
Summary
XML::LibXML::Element in the bundled PerlOnJava compatibility implementation does not provide appendTextNode. Pure-Perl XML::LibXML::Ferry calls this method when creating an element with text, so XML-LibXML-Ferry v0.8.5 aborts in t/ferry-write.t on both PerlOnJava backends.
Reproduction
use XML::LibXML;
my $doc = XML::LibXML::Document->new('1.0', 'UTF-8');
my $element = $doc->createElement('Root');
$element->appendTextNode('text');
Under the PerlOnJava bundled XML::LibXML, this dies with:
Can't locate object method "appendTextNode" via package "XML::LibXML::Element"
The minimal Ferry trigger is:
use XML::LibXML::Ferry;
my $doc = XML::LibXML::Document->new('1.0', 'UTF-8');
my $root = $doc->createElement('Root');
$root->create('Child', 'text');
XML::LibXML::Ferry::create calls $el->appendTextNode($text) at its element-creation path. The bundled src/main/perl/lib/XML/LibXML.pm defines the XML::LibXML::Element interface but has no appendTextNode implementation. System XML::LibXML provides the method, as shown by the complete upstream suite passing under system Perl.
Evidence
- Distribution:
XML-LibXML-Ferryv0.8.5; CPAN run20261119-133823-51077. - PerlOnJava CPAN run:
t/ferry-write.texited 255 after 2 of 15 planned tests; remaining tests did not run becauseappendTextNodewas missing. - System Perl oracle: the full suite passed, 6 test programs and 22 tests, after installing
XML::LibXMLand its prerequisites in an isolated CPAN environment. - Focused API probe on PerlOnJava v5.44.1, source commit
94cc21a9c4e81e1c0fff4debf384efde2f758f93:can("appendTextNode")returned false on both the JVM and interpreter backends. - Runtime used for the probe: Temurin Java 24.0.2 on macOS arm64.
XML::LibXMLreverse-dependency lookup: 492 unique released runtime dependants, 85 with releases in the last five years. This is ecosystem context for the prerequisite; the target Ferry distribution itself is pure Perl.
Expected behavior
The bundled XML::LibXML::Element should support appendTextNode with behavior compatible with system XML::LibXML, so Ferry can create elements containing text and its write tests can run to completion on both backends.
Acceptance criteria
- Add the missing
XML::LibXML::Elementmethod in the shared bundled implementation, matching system XML::LibXML behavior. - Add focused project-owned coverage for appending text to an element, including the Ferry creation path.
- Verify the focused tests under standard Perl, PerlOnJava JVM, and PerlOnJava interpreter backends.
- Re-run
XML-LibXML-Ferryv0.8.5 tests and confirm all 22 tests pass under PerlOnJava.
- 主要語言
- Perl
- 星號
- 67
- 分支
- 8
- 平均合併
- 5 小時 12 分鐘
- 30 天內合併 PR
- 131
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
fglock/PerlOnJava 的其他 Issue
-
area:cpan-port area:parser bug
難度 2/5 1-3 小時 新手友好度 68/100
fglock/PerlOnJava#2137 ·
維護者通常 1 天內回覆
-
area:backend area:cpan-port area:runtime bug
難度 2/5 1-3 小時 新手友好度 76/100
fglock/PerlOnJava#2071 ·
維護者通常 1 天內回覆
-
area:runtime documentation enhancement
難度 2/5 1-3 小時 新手友好度 72/100
fglock/PerlOnJava#1579 ·
維護者通常 1 天內回覆
-
area:cpan-port bug
難度 3/5 1-2 天 新手友好度 62/100
fglock/PerlOnJava#2157 ·
維護者通常 1 天內回覆
-
area:cpan-port area:parser area:runtime bug
難度 3/5 1-2 天 新手友好度 66/100
fglock/PerlOnJava#2156 ·
維護者通常 1 天內回覆
查看 fglock/PerlOnJava 的全部 Issue
相似的 Issue
-
Dev-output directory preparation accepts file-valued lib/include paths and fails on dangling links未關閉team-cli
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 66/100
-
難度 1/5 1 小時以內 新手友好度 93/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 73/100
inverse-inc/packetfence#9728 ·
維護者通常 1 天內回覆
-
fix(char-create): show the real reason a character is refused可能已有人在做 @baphomello 於 1 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆