1 |
=head1 NAME |
2 |
|
3 |
XML::DB - emulate a native xml database using DBI |
4 |
|
5 |
=head1 SYNOPSIS |
6 |
|
7 |
=head1 DESCRIPTION |
8 |
|
9 |
Ehrm... ;) |
10 |
|
11 |
=head1 FUNCTIONS |
12 |
|
13 |
=head1 SEE ALSO |
14 |
|
15 |
=head1 AUTHOR |
16 |
|
17 |
This perl extension was written by Marc Lehmann <pcg@goof.com> |
18 |
|
19 |
=head1 BUGS |
20 |
|
21 |
=cut |
22 |
|
23 |
package XML::DB; |
24 |
|
25 |
sub dk($) { |
26 |
my $x = unpack "H*", $_[0]; |
27 |
$x =~ y/a-z/A-Z/; |
28 |
$x; |
29 |
} |
30 |
|
31 |
use XML::Parser; |
32 |
use PApp::SQL; |
33 |
|
34 |
#require Exporter; |
35 |
BEGIN { |
36 |
$VERSION = 0.01; |
37 |
|
38 |
use base DynaLoader; |
39 |
|
40 |
bootstrap XML::DB $VERSION; |
41 |
} |
42 |
|
43 |
sub new { |
44 |
my $class = shift; |
45 |
bless { @_ }, $class; |
46 |
} |
47 |
|
48 |
sub new_xml_insert_parser { |
49 |
my $did = 55; |
50 |
my $n = 1; |
51 |
|
52 |
my @children = ([]); |
53 |
|
54 |
new XML::Parser |
55 |
NameSpaces => 1, |
56 |
NoExpand => 1, |
57 |
Handlers => { |
58 |
Char => sub { |
59 |
push @{$children[-1]}, ['pcdata', $_[1]]; |
60 |
}, |
61 |
Start => sub { |
62 |
}, |
63 |
End => sub { |
64 |
}, |
65 |
}, |
66 |
@_, |
67 |
; |
68 |
} |
69 |
|
70 |
1; |
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|