1XML::RSS::LibXML::MagicUEsleermeCnotn(t3r)ibuted Perl DoXcMuLm:e:nRtSaSt:i:oLnibXML::MagicElement(3)
2
3
4

NAME

6       XML::RSS::LibXML::MagicElement - Represent A Non-Trivial RSS Element
7

SYNOPSIS

9         us XML::RS::LibXML::MagicElement;
10         my $xml = XML::RSS::LibXML::MagicElement->new(
11           content => $textContent,
12           attributes => \@attributes
13         );
14

DESCRIPTION

16       This module is a handy object that allows users to access non-trivial
17       RSS elements in XML::RSS style. For example, suppose you have an RSS
18       feed with an element like the following:
19
20         <channel>
21           <title>Example</title>
22           <tag attr1="foo" attr2="bar">baz</tag>
23           ...
24         </channel>
25
26       While it is simple to access the title element like this:
27
28         $rss->{channel}->{title};
29
30       It was slightly non-trivial for the second tag. With this module, <tag>
31       is parsed as a XML::RSS::LibXML::MagicElement object and then you can
32       access all the elements like so:
33
34         $rss->{channel}->{tag};  # "baz"
35         $rss->{channel}->{tag}->{attr1}; # "foo"
36         $rss->{channel}->{tag}->{attr2}; # "bar"
37

METHODS

39   new
40       Create a new MagicElement object.
41
42   attributes
43       Returns the list of attributes associated with this element
44
45   toString
46       Returns the string representation of this object.  By default we use
47       the "text content" of the found tag, but for XML::RSS compatibility, we
48       use the concatenation of the attributes if no content is found.
49

AUTHOR

51       Copyright 2005 Daisuke Maki <dmaki@cpan.org>. All rights reserved.
52
53       Development partially funded by Brazil, Ltd. <http://b.razil.jp>
54
55
56
57perl v5.32.0                      2020-07-28 XML::RSS::LibXML::MagicElement(3)
Impressum