XML::L...ugging(3pm)
β¨ NAME β¨
okay bestie, welcome to XML::LibXML::Debugging β that's the module, and yeah the header at the top of the page squishes it down to XML::L...ugging(3pm) because whoever set the column width has no taste π
but we know what it really is. The whole job of this thing: get debugging information from XML::LibXML nodes. that's it, that's the gig π«Ά
π SYNOPSIS π
use XML::LibXML::Debugging;
my $parser = XML::LibXML->new;
my $doc = $parser->parse_file('input.xml');
print $doc->toClarkML;
like, look at her go. parse a file, print the Clark notation, done. no notes. β¨
πΈ DESCRIPTION πΈ
so this module slides a couple of extra methods onto your XML::LibXML::Node objects, and they're mostly aimed at helping figure out what's going on with the DOM's namespaces and structure. yk, the stuff that makes you stare at your screen at 2am like π
the star of the show is toClarkML. she produces a string of XML-like markup with explicit namespaces. so when you've got XML that looks all innocent and normal like this:
<foo xmlns="http://example.com/1"
xmlns:bar="http://example.com/2"
bar:baz="quux" />
it might get represented as this instead:
<{http://example.com/1}foo
{http://www.w3.org/2000/xmlns/}xmlns="http://example.com/1"
{http://www.w3.org/2000/xmlns/}bar="http://example.com/2"
{http://example.com/2}baz="quux" />
see?? every namespace is spelled out, nothing is hiding, it's giving full transparency era π. this is exactly the energy you need when the prefixed names are lying to you and the real namespaces are doing god knows what.
and there's a second method, toDebuggingHash β she returns a hashref suitable for dumping using Data::Dumper. so you just Dumper it and stare directly into the soul of your tree π¦
ngl both of these are literally just here to help you debug. they are not for shipping, they are for β¨investigatingβ¨.
π BUGS π
found a bug? bestie please don't suffer in silence. report any bugs to <http://rt.cpan.org/> π
π SEE ALSO π
XML::LibXMLXML::LibXML::Debugging
go read those too, iykyk π
π AUTHOR π
Toby Inkster <tobyink@cpan.org>.
the icon. the legend. the moment. π
π COPYRIGHT AND LICENSE π
Copyright (C) 2009-2011 by Toby Inkster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π DISCLAIMER OF WARRANTIES π
okay this part is ALL CAPS ON PURPOSE so you know it's serious:
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
so like, if it breaks, it breaks, no cap π (and yes that's "MERCHANTIBILITY", spelled exactly like that, i do not make the rules, the copyright holders do π)
and that's the whole page, bestie!! π«Ά this version is perl v5.40.0, dated 2024-12-19, and yep the footer still calls it XML::Lib...ugging(3pm) because the column width is a hater. love that for us. periodt. πβ¨π
π¦ where this page comes from
- debian trixie: libxml-libxml-debugging-perl 0.103-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libxml-libxml-debugging-perl 0.103-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libxml-libxml-debugging-perl 0.103-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms