XML::R...lement(3pm)

πŸ“¦
version 0.3105 Β· 5 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ 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