1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl
use XML::LibXML;
use Switch;
my $object = $ARGV[0];
my $datei = 'bla.xml';
my $mein_objekt = XML::LibXML->new();
my $Baumobjekt = $mein_objekt->parse_file($datei);
my $wurzel = $Baumobjekt->getDocumentElement;
my @knoten = $wurzel->getElementsByTagName('lst');
my @knot = $wurzel->getElementsByTagName('long');
my @objects;
my @content1;
my $i = 0;
foreach my $einzelne_Knoten (@knot)
{
$name=$einzelne_Knoten->getAttribute('name');
$content2=$einzelne_Knoten->textContent;
print "$name = $content2 \n";
$objects[$i] = $name;
$content1[$i] = $content2;
$i++;
}
print "\n$objects[5] = $content1[5]\n";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?xml version="1.0" encoding="UTF-8" ?>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">53649</int>
</lst>
<lst name="report">
<lst name="alfresco">
<long name="DB transaction count">136902</long>
<long name="DB acl transaction count">970</long>
<long name="Count of duplicated transactions in the index">0</long>
<long name="Count of duplicated acl transactions in the index">0</long>
<long name="Count of transactions in the index but not the DB">0</long>
<long name="Count of acl transactions in the index but not the DB">0</long>
<long name="Count of missing transactions from the Index">0</long>
<long name="Count of missing acl transactions from the Index">0</long>
<long name="Index transaction count">136902</long>
<long name="Index acl transaction count">970</long>
<long name="Index unique transaction count">136902</long>
<long name="Index unique acl transaction count">970</long>
<long name="Index leaf count">628585</long>
<long name="Count of duplicate leaves in the index">0</long>
<long name="Index aux count">628585</long>
<long name="Count of duplicate aux docs in the index">0</long>
<long name="Index error count">0</long>
<long name="Count of duplicate error docs in the index">0</long>
<long name="Index unindexed count">1812</long>
<long name="Count of duplicate unindexed docs in the index">0</long>
<long name="Last index commit time">1370343490031</long>
<str name="Last Index commit date">2013-06-04T12:58:10</str>
<long name="Last TX id before holes">138452</long>
</lst>
<lst name="archive">
<long name="DB transaction count">136902</long>
<long name="DB acl transaction count">970</long>
<long name="Count of duplicated transactions in the index">0</long>
<long name="Count of duplicated acl transactions in the index">0</long>
<long name="Count of transactions in the index but not the DB">0</long>
<long name="Count of acl transactions in the index but not the DB">0</long>
<long name="Count of missing transactions from the Index">0</long>
<long name="Count of missing acl transactions from the Index">0</long>
<long name="Index transaction count">136902</long>
<long name="Index acl transaction count">970</long>
<long name="Index unique transaction count">136902</long>
<long name="Index unique acl transaction count">970</long>
<long name="Index leaf count">1463</long>
<long name="Count of duplicate leaves in the index">0</long>
<long name="Index aux count">1463</long>
<long name="Count of duplicate aux docs in the index">0</long>
<long name="Index error count">0</long>
<long name="Count of duplicate error docs in the index">0</long>
<long name="Index unindexed count">0</long>
<long name="Count of duplicate unindexed docs in the index">0</long>
<long name="Last index commit time">1370343490031</long>
<str name="Last Index commit date">2013-06-04T12:58:10</str>
<long name="Last TX id before holes">138452</long>
</lst>
</lst>
</response>
my @knot = $wurzel->findnodes('//lst[@name="alfresco"]');
1
2
my $mein_objekt = XML::LibXML->load_xml(location => "http://bla/cores?action=REPORT&wt=xml");
my $wurzel = $mein_objekt->getDocumentElement;
1
2
3
my $mein_objekt = XML::LibXML->new();
my $Baumobjekt = $mein_objekt->parse_file("http://bla/cores?action=REPORT&wt=xml");
my $wurzel = $Baumobjekt->getDocumentElement;
1
2
3
Beides bringt die Fehlermeldung:
Could not create file parser context for file "http://bla/cores?action=REPORT&wt=xml": Resource temporarily unavailable at inc.pm line 10.