line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
XML::Easy::Content - abstract form of XML content |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 SYNOPSIS |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use XML::Easy::Content; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$content = XML::Easy::Content->new([ |
10
|
|
|
|
|
|
|
"foo", |
11
|
|
|
|
|
|
|
$subelement, |
12
|
|
|
|
|
|
|
"bar", |
13
|
|
|
|
|
|
|
]); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
$twine = $content->twine; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 DESCRIPTION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
An object of this class represents a chunk of XML content, the kind |
20
|
|
|
|
|
|
|
of matter that can be contained within an XML element. This is in an |
21
|
|
|
|
|
|
|
abstract form, intended for general manipulation. It is completely |
22
|
|
|
|
|
|
|
isolated from the textual representation of XML, and holds only the |
23
|
|
|
|
|
|
|
meaningful content of the chunk. The data in a content object cannot |
24
|
|
|
|
|
|
|
be modified: different data requires the creation of a new object. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
An XML content chunk consists of a sequence of zero or more characters |
27
|
|
|
|
|
|
|
and XML elements, interspersed in any fashion. Character content can |
28
|
|
|
|
|
|
|
use almost all Unicode characters, with only a few characters (such as |
29
|
|
|
|
|
|
|
most of the ASCII control characters) prohibited by the specification |
30
|
|
|
|
|
|
|
from being directly represented in XML. Each XML element in a content |
31
|
|
|
|
|
|
|
chunk itself recursively contains a chunk of content, in addition to |
32
|
|
|
|
|
|
|
having attached metadata. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
This class is not meant to be subclassed. XML content is unextendable, |
35
|
|
|
|
|
|
|
dumb data. Content objects are better processed using the functions in |
36
|
|
|
|
|
|
|
L than using the methods of this class. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
package XML::Easy::Content; |
41
|
|
|
|
|
|
|
|
42
|
13
|
|
|
13
|
|
291379
|
{ use 5.008; } |
|
13
|
|
|
|
|
57
|
|
43
|
13
|
|
|
13
|
|
70
|
use warnings; |
|
13
|
|
|
|
|
27
|
|
|
13
|
|
|
|
|
376
|
|
44
|
13
|
|
|
13
|
|
1008
|
use strict; |
|
13
|
|
|
|
|
35
|
|
|
13
|
|
|
|
|
2553
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
our $VERSION = "0.011"; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
eval { local $SIG{__DIE__}; |
49
|
|
|
|
|
|
|
require XSLoader; |
50
|
|
|
|
|
|
|
XSLoader::load("XML::Easy", $VERSION) unless defined &new; |
51
|
|
|
|
|
|
|
}; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
if($@ eq "") { |
54
|
|
|
|
|
|
|
close(DATA); |
55
|
|
|
|
|
|
|
} else { |
56
|
|
|
|
|
|
|
(my $filename = __FILE__) =~ tr# -~##cd; |
57
|
|
|
|
|
|
|
local $/ = undef; |
58
|
|
|
|
|
|
|
my $pp_code = "#line 75 \"$filename\"\n".; |
59
|
|
|
|
|
|
|
close(DATA); |
60
|
|
|
|
|
|
|
{ |
61
|
|
|
|
|
|
|
local $SIG{__DIE__}; |
62
|
|
|
|
|
|
|
eval $pp_code; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
die $@ if $@ ne ""; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
*content = \&twine; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__DATA__ |