Re: [xml] get contents literally (or strip outer element tags)?
- From: "Hans Martin" <HMartin1 gmx net>
- To: "Aron Stansvik" <elvstone gmail com>, xml gnome org
- Subject: Re: [xml] get contents literally (or strip outer element tags)?
- Date: Sun, 02 Mar 2008 18:22:10 +0100
Datum: Sun, 2 Mar 2008 17:05:05 +0100
Von: "Aron Stansvik" <elvstone gmail com>
2008/3/2, Hans Martin <HMartin1 gmx net>:
I'm using libxml2 2.6.31 with Python 2.4. I try to get from:
<a>some <b>content</b> is ∈ here</a>
the content of "a" unchanged:
some <b>content</b> is ∈ here
For this, I think you need to traverse the children of <a> and dump
them individually. E.g:
Thanks, this works great. Just for reference, here the Python code:
a_list = []
cur = elem.children
while cur != None:
a_list.append(str(cur))
cur = cur.next
print "".join(a_list)
Cheers!
--
Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games!
http://games.entertainment.web.de/de/entertainment/games/free
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]