[XML-SIG] elementtree and uncomplete parsing

jeanmarc.chourot at free.fr jeanmarc.chourot at free.fr
Fri Jun 20 22:40:42 CEST 2008


Hi all,

As a noob, I cannot find the way to make an incomplete parse of a tree.
For instance, please consider the following xml file

<node>
This text <thistag> is completely crap </thistag> because <anothertag> blabla
</anothertag>
</node>
<node>
This is another <thisnotag> node </thisnotag> with <anothertaggy> random tags
</anothertaggy>
</node>

I would like to retrieve what is between the tags <node> ...</node> into
strings, the "subelements" being considered as simple string and not processed
by elelement tree.
In other words, this could be badly formed HTML  not processed embeded into well
formed xml tags.

i.e. :
string1 = "This text <thistag> is completely crap </thistag> because
<anothertag> blabla </anothertag>"
string2="This is another <thisnotag> node </thisnotag> with <anothertaggy>
random tags </anothertaggy>"

Could anyone help me with this  ?
Thanks a lot


More information about the XML-SIG mailing list