Implement XML::LibXML::Element->appendTextNode

Abierto Apto para principiantes
#2,153 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
70/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java, perl
Área
compilers

Línea de trabajo

Empieza en src/main/perl/lib/XML/LibXML.pm, donde se define la interfaz XML::LibXML::Element, y compárala con los métodos vecinos de texto/hijos ya implementados allí para ver cómo se representan los nodos. Replica la semántica de appendTextNode de XML::LibXML del sistema, luego añade una prueba enfocada (incluida la ruta XML::LibXML::Ferry::create) y ejecútala con Perl, la JVM y los backends de intérprete. Hecho significa que can("appendTextNode") de la sonda es verdadero y que t/ferry-write.t de Ferry v0.8.5 ejecuta las 22 pruebas hasta completarlas.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Perl
Estrellas
67
Forks
8
Merge medio
5 h 12 min
PR fusionados (30 d)
131

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de fglock/PerlOnJava

Todos los issues de fglock/PerlOnJava

Issues similares

Más issues de Perl

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.