Add XML::LibXML Node localName method alias

Open Beginner friendly
#2,164 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java, perl
Domain
backend

Research direction

The method table for the XML::LibXML::Node registration is in XMLLibXML.java, where localname and getLocalName already map to the same implementation. Start there and add localName as a further alias of that entry. The minimal reproduction in the issue, run through ./jperl and ./jperl --interpreter, should print schema; a focused regression test for the camel-case spelling should pass on both backends and under standard Perl.

Written by the indexing model from the issue text.

Description

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.
Dominant language
Perl
Stars
67
Forks
8
Avg merge
4h 36m
Merged PRs (30d)
123

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fglock/PerlOnJava

All issues in fglock/PerlOnJava

Similar issues

More Perl issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.