Ich habe mit dem folgenden Skript getestet:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/local/bin/perl -w
use strict;
use warnings;
use Data::Dumper;
use XML::Simple;
my $file = shift;
my $xs = new XML::Simple();
my $ref = $xs->XMLin( $file );
print Dumper ($ref);
1;
Diese XML-Datei
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<document path="G:\http\public\projekte\WebEND\test\test.xml">
<meta>
<permission allowed="*" denied="4,5">TEST</permission>
<title text="TPL_MAKEOWN" />
</meta>
<![CDATA[
<content execute="tmpl">
<html>
<head>
<title>...</title>
</head>
<body>
<p>HTML INHALT</p>
</body>
</html>
</content>
]]>
</document>
wird mit XML::Simple folgendermaßen geparst:
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
$VAR1 = {
'content' => '
<content execute="tmpl">
<html>
<head>
<title>...</title>
</head>
<body>
<p>HTML INHALT</p>
</body>
</html>
</content>
',
'path' => 'G:\\http\\public\\projekte\\WebEND\\test\\test.xml',
'meta' => {
'permission' => {
'allowed' => '*',
'content' => 'TEST',
'denied' => '4,5'
},
'title' => {
'text' => 'TPL_MAKEOWN'
}
}
};
Da kommst du doch an den Inhalt von Content dran und kannst den an das Template-Modul weiterleiten! ???