Implement XML::LibXML::Element->appendTextNode

未關閉 適合新手
#2,153 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
70/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
java, perl
領域
compilers

研究方向

從 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 內容生成。

描述

area:cpan-port bug

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-Ferry v0.8.5; CPAN run 20261119-133823-51077.
  • PerlOnJava CPAN run: t/ferry-write.t exited 255 after 2 of 15 planned tests; remaining tests did not run because appendTextNode was missing.
  • System Perl oracle: the full suite passed, 6 test programs and 22 tests, after installing XML::LibXML and 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::LibXML reverse-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::Element method 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-Ferry v0.8.5 tests and confirm all 22 tests pass under PerlOnJava.
主要語言
Perl
星號
67
分支
8
平均合併
5 小時 12 分鐘
30 天內合併 PR
131

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

fglock/PerlOnJava 的其他 Issue

查看 fglock/PerlOnJava 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。