1 |
joko |
1.1 |
#!/usr/bin/perl |
2 |
|
|
|
3 |
|
|
## ------------------------------------------------------------------------- |
4 |
joko |
1.2 |
## $Id: xupdate.pl,v 1.1 2003/05/01 20:41:47 joko Exp $ |
5 |
joko |
1.1 |
## ------------------------------------------------------------------------- |
6 |
|
|
## $Log: xupdate.pl,v $ |
7 |
joko |
1.2 |
## Revision 1.1 2003/05/01 20:41:47 joko |
8 |
|
|
## initial commit, partly from joko/Scripts/xupdate/xupdate.pl. |
9 |
|
|
## |
10 |
joko |
1.1 |
## ------------------------------------------------------------------------- |
11 |
|
|
|
12 |
|
|
|
13 |
|
|
=pod |
14 |
|
|
|
15 |
|
|
|
16 |
|
|
=head1 NAME |
17 |
|
|
|
18 |
|
|
xupdate.pl |
19 |
|
|
|
20 |
|
|
|
21 |
|
|
=head2 Description |
22 |
|
|
|
23 |
|
|
Please visit "perldoc XML::XUpdate::XSLT". |
24 |
|
|
|
25 |
|
|
|
26 |
|
|
=head3 Todo |
27 |
|
|
|
28 |
|
|
o mimic interface from already established "xupdate.pl" |
29 |
|
|
o replace shortcuts::files through File::Butler? |
30 |
|
|
|
31 |
|
|
|
32 |
|
|
=cut |
33 |
|
|
|
34 |
|
|
|
35 |
|
|
package main; |
36 |
|
|
|
37 |
|
|
use strict; |
38 |
|
|
use warnings; |
39 |
|
|
|
40 |
|
|
BEGIN { |
41 |
|
|
use lib '../../libs'; |
42 |
|
|
} |
43 |
|
|
|
44 |
|
|
use XML::XUpdate::XSLT; |
45 |
|
|
use shortcuts::files qw( f2s ); |
46 |
|
|
use Data::Dumper; |
47 |
|
|
|
48 |
|
|
|
49 |
|
|
sub main { |
50 |
|
|
|
51 |
|
|
my $xupdate = XML::XUpdate::XSLT->new( |
52 |
joko |
1.2 |
debug => 0, |
53 |
|
|
warnings => 1, |
54 |
joko |
1.1 |
); |
55 |
|
|
|
56 |
|
|
#print Dumper($xupdate); |
57 |
|
|
|
58 |
|
|
# open required files |
59 |
|
|
$xupdate->open_document( f2s("wd_document.xml") ); |
60 |
|
|
$xupdate->open_xupdate( f2s("wd_xupdate.xml") ); |
61 |
|
|
|
62 |
|
|
$xupdate->process(); |
63 |
|
|
my $result = $xupdate->toString(); |
64 |
|
|
|
65 |
|
|
# some error checking ... |
66 |
|
|
if ($result) { |
67 |
|
|
print $result, "\n"; |
68 |
|
|
} else { |
69 |
|
|
print "No result.", "\n"; |
70 |
|
|
} |
71 |
|
|
|
72 |
|
|
} |
73 |
|
|
|
74 |
|
|
main(); |
75 |
|
|
print "ready.", "\n"; |
76 |
|
|
|
77 |
|
|
1; |
78 |
|
|
__END__ |