Registered Member
|
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. |
Administrator
|
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] |
Registered Member
|
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\">" ); |
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell