Add XML::LibXML Node localName method alias

Offen Anfängerfreundlich
#2,164 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
72/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
java, perl
Bereich
backend

Rechercherichtung

Die Methodentabelle für die Registrierung von XML::LibXML::Node befindet sich in XMLLibXML.java, wo localname und getLocalName bereits auf dieselbe Implementierung abgebildet sind. Beginne dort und füge localName als weiteren Alias für diesen Eintrag hinzu. Das minimale Reproduktionsbeispiel aus dem Issue sollte, über ./jperl und ./jperl --interpreter ausgeführt, schema ausgeben; ein gezielter Regressionstest für die camelCase-Schreibweise sollte auf beiden Backends und unter Standard-Perl bestehen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area:runtime bug

Summary

PerlOnJava's XML::LibXML::Node method table does not expose the camel-case localName method. A caller using this public method gets a method-not-found error, even though the XML::LibXML compatibility implementation provides the equivalent DOM operation as localname.

Minimal reproduction

use XML::LibXML;
my $doc = XML::LibXML->load_xml(string => '<schema/>');
my $root = $doc->documentElement;
print $root->localName, "\n";

Expected output:

schema

Observed on both PerlOnJava backends:

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

System Perl with XML::LibXML prints schema.

Root cause

XML::Compile 1.64 calls $this->localName in XML/Compile/Schema.pm while checking the root schema element. In XMLLibXML.java, the XML::LibXML::Node registration table maps localname and getLocalName to the localname implementation, but does not register the exact, case-sensitive method name localName. PerlOnJava's package method dispatch therefore cannot resolve the call. The issue reproduces directly without Data::DublinCore and affects both JVM and interpreter execution.

A likely fix is to register localName as another alias of the existing localname implementation, then add focused coverage for the camel-case API spelling on both backends.

CPAN evidence

  • Distribution: Data-DublinCore 1.00
  • Archived CPAN run: 20261121-154046-78188
  • PerlOnJava failure: t/20rdf.t aborts before running its 8 assertions; t/01use.t and t/99pod.t pass.
  • System-Perl oracle: all 3 target test files pass, 14 tests total, using the run's installed prerequisites.
  • Focused minimal reproduction: ./jperl and ./jperl --interpreter both fail; system Perl succeeds.
  • Environment: macOS 15.6 arm64, OpenJDK 24.0.2; the oracle log reports Perl 5.42.2. The separate focused system-Perl check used Perl 5.34.1.

Acceptance criteria

  • XML::LibXML::Element->localName resolves to the same local-name value as the existing localname method.
  • Add a project-owned focused regression test for the camel-case spelling.
  • The focused test passes on the JVM and interpreter backends and under standard Perl.
  • The Data-DublinCore 1.00 t/20rdf.t test passes with its prerequisites installed.
Vorherrschende Sprache
Perl
Sterne
67
Forks
8
Ø Merge
4 Std. 36 Min.
Gemergte PRs (30 T.)
123

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus fglock/PerlOnJava

Alle Issues in fglock/PerlOnJava

Ähnliche Issues

Weitere Issues zu Perl

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.