Implement XML::LibXML::Element->appendTextNode

オープン 初心者向け
#2,153 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
70/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java, perl
領域
compilers

調査の方向性

src/main/perl/lib/XML/LibXML.pm から始めます。ここで XML::LibXML::Element インターフェースが定義されているので、既にそこで実装されている隣接するテキスト/子メソッドと比較し、ノードがどのように表現されるかを確認します。システムの 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分
マージ済み PR(30日)
131

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fglock/PerlOnJava のほかの issue

fglock/PerlOnJava の issue をすべて見る

似ている issue

Perl の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。