[reportlab-users] lib.rparsexml.parsexmlSimple from current.tgz

Igor Stroh reportlab-users@reportlab.com
30 Jun 2003 14:02:47 +0200


On Mon, 2003-06-30 at 13:50, Jerome Alet wrote:

> > I have problems using the above function, I get an "unpack tuple of
> > wrong size" Exception from line lib/rparsexml.py:101 when the xmltext
> > parameter contains a single & or a < but no xml tags. 
> 
> Maybe you should try to escape these characters :
> 
>   s = "your xmltext"
>   s = s.replace("&", "&amp;")
>   s = s.replace(">", "&gt;")
>   s = s.replace("<", "&lt;")
>   do_something(s)

It doesn't work (tried already), the point is, lib.rparsexml.parsexml0()
which is called in parsexmlSimple() returns a tuple consisting of four
members instead of a two-members tuple... I tried to catch this case and
reformat the result so the unpack works, but I don't know what the tuple
should look like... my best bet displayed the text with a "new line"
after the ampersand (although there is none).

Greetings,
Igor