This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Perl module for .kvtml files

Tags: None
(comma "," separated)
forrest.tb
Registered Member
Posts
2
Karma
0
OS

Perl module for .kvtml files

Tue Nov 09, 2010 2:24 am
Has anyone encountered any perl module or code for reading and writing kvtml files, as used by Parley and other applications?

I have some perl code that chops an audio file to individual words, then I will spin vocabulary lessons direct from that.

Messing around with the XML modules in perl wouldn't take to long I guess but just thought such a library may already exist.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Perl module for .kvtml files

Tue Nov 09, 2010 2:53 am
There does appear to be general Perl bindings for KDE, so these bindings may provide access to the C++ based kvtml libraries.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
forrest.tb
Registered Member
Posts
2
Karma
0
OS
Thanks for the perl bindings hint. I also seems getting kvtml files in and out of perl seems quite easy using the XML::Simple module.

For anyone actually wanting to do this i found some initialiser options were necessary

my $obj = XML::Simple->new(KeepRoot => 1, ForceArray => 1, KeyAttr => { entry => 'id' });
my $xs = $obj->XMLin('./lesson00.kvtml');



# ..and to write it back out use something like
$obj->XMLout($xs,
KeepRoot => 1,
OutputFile => 'out.fixed.kvtml',
XMLDecl => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE kvtml PUBLIC \"kvtml2.dtd\" \"http://edu.kde.org/kvtml/kvtml2.dtd\">"
);


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell