XML::R...lement(3pm)
β¨ NAME β¨
XML::RSS::LibXML::MagicElement β the icon of representing a non-trivial RSS element π
β¨
okay so bestie, this is a manual page for XML::RSS::LibXML::MagicElement(3pm), and it lives in the User Contributed Perl Documentation corner of your perldoc, no cap π
π¦ SYNOPSIS π¦
like, here's the whole vibe, fr fr:
us XML::RS::LibXML::MagicElement;
my $xml = XML::RSS::LibXML::MagicElement->new(
content => $textContent,
attributes => \@attributes
);
(yes the first line really does say us XML::RS::LibXML::MagicElement; β that's a typo in the original, don't come for me, I'm just the messenger π)
πΈ DESCRIPTION πΈ
This module is a handy little object, and the way it lets you access non-trivial RSS elements in XML::RSS style is genuinely giving main character energy π
so imagine you've got an RSS feed with an element that looks like this:
<channel>
<title>Example</title>
<tag attr1="foo" attr2="bar">baz</tag>
...
</channel>
getting at the title element? easy peasy, iconic, no thoughts:
$rss->{channel}->{title};
but that second tag? lowkey it was slightly non-trivial to grab π
enter this module. with it, <tag> gets parsed as a XML::RSS::LibXML::MagicElement object, and then you can access all the elements like so:
$rss->{channel}->{tag}; # "baz"
$rss->{channel}->{tag}->{attr1}; # "foo"
$rss->{channel}->{tag}->{attr2}; # "bar"
slay. obsessed. periodt π
π METHODS π
π new
Create a new MagicElement object. fresh out the box, brand new, π
π attributes
Returns the list of attributes associated with this element. all of them. the whole squad π«Ά
π toString
Returns the string representation of this object.
By default we use the "text content" of the found tag, but for XML::RSS compatibility, we use the concatenation of the attributes if no content is found. yep, that's the rule, that's the whole rule β¨
π AUTHOR π
Copyright 2005 Daisuke Maki <dmaki@cpan.org>. All rights reserved. π
Development partially funded by Brazil, Ltd. <http://b.razil.jp> π
k so that's the whole page bestie, go forth and parse your weird little RSS tags π¦
cute sign-off time: this was perl v5.38.2, dated 2024-03-09, from XML::R...lement(3pm) β stan a legend, iykyk βπ
π¦ where this page comes from
- debian trixie: libxml-rss-libxml-perl 0.3105+dfsg-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libxml-rss-libxml-perl 0.3105+dfsg-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libxml-rss-libxml-perl 0.3105+dfsg-4 Β· 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