Tanja wrote:
> Hello,
>
> I found something strange while using kaa.xml for a kaa.epg source.
> I do have to process several xml files and thus tried to create on big
> tree from all files by using Node.add_child() from kaa.xml.

I had similar problems when doing the new config stuff.

> What I observed is:
> 1.) after calling once add_child for ONE child, all its siblings are
> also added to the new tree

I never say that. What happens if you use libxml2 directly and not the
kaa wrapper?

> 2.) moreover I see a strange "Segmentation fault", when the programm
> is finished.

That is libxml2. It is a strange interface. You have to call free
yourself. Since I don't like that, the tree is freed when the original
root node reference is lost. So after that, the whole tree is
invalid. Remove the __del__ at the end of kaa.xml and you should see
that it works. But the real problem is that when you add a child, the
child is on _both_ trees resulting to two frees. That is kind of
strange. You need to unparent the child first.

But why are you modifing the tree? Why not just parse and the the
stuff to kaa.epg.db (I guess that is what you are doing). No need for
creating a xml file.

One other note: your original parser used SAX and kaa.xml does not
support this. This is only a limitation of kaa.xml, libxml2 can handle
this. So you could either add SAX support to kaa.xml or use libxml2
directly and I will add the needed stuff when you send the parser to
me. One warning: libxml2 always returns UTF-8. That is the main reason
for the kaa.xml wrapper, it is more or less a copy of the libxml2 code
but converts strings to unicode.



Dischi


-- 
The students were staring at her in the manner of those who have heard of
the species 'female' but have never expected to get this close to one.
        -- (Terry Pratchett, Soul Music)

Attachment: pgp9ydtAcykLu.pgp
Description: PGP signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to