Implement XML::LibXML::Element->getNamespace

Abierto
#2,227 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
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
70/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java
Área
backend

Línea de trabajo

Read the XML::LibXML::Element method table and Perl shim, then inspect the existing Java localNS implementation. Add focused coverage for namespaced and unnamespaced elements, and validate with standard Perl and both PerlOnJava backends. Done means getNamespace returns a compatible XML::LibXML::Namespace and the four named WWW-OpenSearch test programs pass.

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

Descripción

area:cpan-port area:runtime bug

Summary

The bundled XML::LibXML compatibility implementation does not expose XML::LibXML::Element->getNamespace. WWW-OpenSearch 0.17 calls this method while parsing an OpenSearch description, so four of its test programs abort under PerlOnJava even though the same upstream suite passes under standard Perl with XML::LibXML installed.

Reproduction

use XML::LibXML;
my $doc = XML::LibXML->load_xml(
    string => '<Description xmlns="http://a9.com/-/spec/opensearch/1.1/"/>',
);
print $doc->documentElement->getNamespace->value, "\n";

Expected: the namespace object's value is http://a9.com/-/spec/opensearch/1.1/.

Observed on both PerlOnJava backends:

Can't locate object method "getNamespace" via package "XML::LibXML::Element"

Root cause

WWW::OpenSearch::Description calls $element->getNamespace->value while parsing its description XML. In the bundled implementation, XML::LibXML::Element inherits the node method table, which registers localNS and getNamespaces but has no getNamespace entry. The Perl shim also has no singular getNamespace wrapper. The underlying Java implementation already has localNS, which constructs an XML::LibXML::Namespace object from the element's namespace URI and prefix; the missing method name prevents callers from reaching that existing behavior.

CPAN evidence

  • Distribution: WWW-OpenSearch 0.17; archived CPAN run 20261129-192130-74689.
  • PerlOnJava failed t/09-opensearch.t, t/10-description.t, t/11-url.t, and t/13-request.t at the missing method call. t/00_compile.t, t/12-response.t, and the POD tests passed; t/01_live.t was skipped because OPENSEARCH_URL was unset.
  • The standard-Perl oracle for that run passed all 9 test programs and 120 tests with XML::LibXML and prerequisites installed in its isolated environment. The live test remained skipped because no OPENSEARCH_URL was set.
  • A focused reproduction on PerlOnJava 5.44.1, source revision 1eb25df1f686dcc5b90e839de05d21a5d14aec0c, with Java 24.0.2 failed on both the JVM and interpreter backends with the method-not-found error above.

Acceptance criteria

  • XML::LibXML::Element->getNamespace returns an XML::LibXML::Namespace object with behavior compatible with standard XML::LibXML, including its URI through value.
  • Add project-owned focused coverage for namespaced and unnamespaced elements, validated with standard Perl and both PerlOnJava backends.
  • Re-run WWW-OpenSearch 0.17 and confirm the four affected test programs complete and pass under PerlOnJava.
Lenguaje dominante
Perl
Estrellas
67
Forks
9
Merge medio
6 h 45 min
PR fusionados (30 d)
104

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.