Summary
The HTML-DTD 0.04 test suite fails under PerlOnJava because the bundled
XML::LibXML compatibility layer does not provide
XML::LibXML::Dtd->parse_string.
This is a PerlOnJava API-compatibility gap, not an HTML-DTD implementation
failure.
CPAN evidence
- Distribution:
HTML-DTD 0.04
- CPAN run:
20260910-101908-8428
- Failing test:
t/validate.t
- System Perl: the complete suite passed after installing HTML-DTD into an
isolated prefix; the validation test was skipped because the system lacked
XML::LibXML. An isolated XML::LibXML installation attempt was blocked by a
missing Alien::Libxml2 prerequisite and unavailable CPAN network access.
- PerlOnJava: five test programs pass;
t/validate.t aborts when it calls the
missing method.
Failure
PerlOnJava reports:
Can't locate object method "parse_string" via package "XML::LibXML::Dtd"
The minimal reproducer is:
use XML::LibXML;
my $dtd = XML::LibXML::Dtd->parse_string('<!ELEMENT root EMPTY>');
This fails under jperl with exit status 255. The same API is used by
HTML-DTD's t/validate.t after obtaining the XHTML DTD text.
Root cause
The bundled Perl implementation declares XML::LibXML::Dtd as a subclass of
XML::LibXML::Node, and the Java implementation wraps document-type nodes,
but no parse_string method is implemented or registered for the Dtd
package.
Expected behavior
XML::LibXML::Dtd->parse_string should parse a DTD string and return a usable
XML::LibXML::Dtd object with behavior compatible with upstream XML::LibXML.
Acceptance criteria
- Add a focused project-owned regression test for
XML::LibXML::Dtd->parse_string.
- Confirm the expected behavior with system Perl using a usable XML::LibXML
installation.
- Implement and register the Dtd parsing API in the PerlOnJava XML::LibXML
compatibility layer.
- Run the focused regression on both JVM and interpreter backends.
- Verify that HTML-DTD 0.04
t/validate.t passes under PerlOnJava.
- Keep existing XML::LibXML compatibility tests green.
Summary
The
HTML-DTD0.04 test suite fails under PerlOnJava because the bundledXML::LibXMLcompatibility layer does not provideXML::LibXML::Dtd->parse_string.This is a PerlOnJava API-compatibility gap, not an HTML-DTD implementation
failure.
CPAN evidence
HTML-DTD0.0420260910-101908-8428t/validate.tisolated prefix; the validation test was skipped because the system lacked
XML::LibXML. An isolated XML::LibXML installation attempt was blocked by a
missing
Alien::Libxml2prerequisite and unavailable CPAN network access.t/validate.taborts when it calls themissing method.
Failure
PerlOnJava reports:
The minimal reproducer is:
This fails under
jperlwith exit status 255. The same API is used byHTML-DTD'st/validate.tafter obtaining the XHTML DTD text.Root cause
The bundled Perl implementation declares
XML::LibXML::Dtdas a subclass ofXML::LibXML::Node, and the Java implementation wraps document-type nodes,but no
parse_stringmethod is implemented or registered for the Dtdpackage.
Expected behavior
XML::LibXML::Dtd->parse_stringshould parse a DTD string and return a usableXML::LibXML::Dtdobject with behavior compatible with upstream XML::LibXML.Acceptance criteria
XML::LibXML::Dtd->parse_string.installation.
compatibility layer.
t/validate.tpasses under PerlOnJava.