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 天内回复