There is a slightly updated version of trml2pdf that is floating around out
there. It is included in the ubuntu repository and I have also preserved a
copy here - http://www.satchmoproject.com/snapshots/trml2pdf-1.2.tar.gz

This version is supposed to be smarter about unicode and other special
characters. Would you try removing your old trml2pdf and using the new one.
It doesn't blow up for me.

Thanks,
Chris

On Fri, Aug 21, 2009 at 4:01 PM, ANIL KARADAĞ <[email protected]>wrote:

> Hi,
>
> '&' is unwanted character in xml so you should use CDATA
>
>  for example:
>
>  *<para><![CDATA[&]]></para>*
>
> 2009/8/21 Pete <[email protected]>
>
>
>> We have a store with a product that contains an ampersand (&) in it's
>> name, which trml2pdf appears to be choking on when trying to print
>> invoices. From what I've read trml2pdf is not very unicode friendly.
>> Is there a work-around (other than renaming the product)?
>>
>> Here is the error:
>>
>> Traceback (most recent call last):
>>
>>  File "/home/mysite/webapps/production/lib/python2.5/django/core/
>> handlers/base.py", line 86, in get_response
>>   response = callback(request, *callback_args, **callback_kwargs)
>>
>>  File "/home/mysite/webapps/production/lib/python2.5/django/contrib/
>> admin/views/decorators.py", line 33, in _checklogin
>>   return view_func(request, *args, **kwargs)
>>
>>  File "/home/mysite/webapps/production/lib/python2.5/django/views/
>> decorators/cache.py", line 44, in _wrapped_view_func
>>   response = view_func(request, *args, **kwargs)
>>
>>  File "/home/mysite/lib/python2.5/satchmo/shipping/views.py", line 41,
>> in displayDoc
>>   pdf = trml2pdf.parseString(smart_str(t.render(c)))
>>
>>  File "/home/mysite/lib/python2.5/trml2pdf/trml2pdf.py", line 531, in
>> parseString
>>   r = _rml_doc(data)
>>
>>  File "/home/mysite/lib/python2.5/trml2pdf/trml2pdf.py", line 138, in
>> __init__
>>   self.dom = xml.dom.minidom.parseString(data)
>>
>>  File "/usr/local/lib/python2.5/site-packages/_xmlplus/dom/
>> minidom.py", line 1925, in parseString
>>   return expatbuilder.parseString(string)
>>
>>  File "/usr/local/lib/python2.5/site-packages/_xmlplus/dom/
>> expatbuilder.py", line 942, in parseString
>>   return builder.parseString(string)
>>
>>  File "/usr/local/lib/python2.5/site-packages/_xmlplus/dom/
>> expatbuilder.py", line 223, in parseString
>>   parser.Parse(string, True)
>>
>> ExpatError: not well-formed (invalid token): line 143, column 48
>>
>>
>
>
> --
> Anıl KARADAĞ
> Cihan Bilişim A.Ş. - Yazılım Geliştirme Uzmanı
> GYTE- Bilgisayar Müh. Yüksek Lisans öğrencisi
> http://anilkaradag.info/blog
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to