[reportlab-users] UsersGuide Platypus including '<' in text

george georgel at telebyte.com
Sun Oct 29 21:06:42 EST 2006


That doesn't work.
I goofed on earlier code
Here's the code with &lt

    Story.append(Paragraph("""
    The lines are a bit jagged.
    Inspection of the table indicates that the
    values have been rounded to 100 calorie increments.
    Next I'll try to approximate these lines.
    """,style))

    Story.append(Paragraph('m*x + b &lt limit',style))

    Story.append(Paragraph("""
    The lines should be of the form y = m*x +b.
    We need 3 lines denoted by m0 ... m3, b0 ... b3.
    For each data point error = y-m*x-b and error le maxe and error ge mine.
    We must minimize maxe1-mine1+maxe2-mine1+maxe3-mine3.
    The for columns in the tableau I use m1, b1, min1, max1,
    ,m2, b2, min2, max2, m3, b3, min3, max3.
    """,style))

Here's the result

     >>> ================================ RESTART
    ================================
     >>>

    Traceback (most recent call last):
      File "L:\HereAndThere\BLOODSUGAR\caloryCount.py", line 143, in
    -toplevel-
        Story.append(Paragraph('m*x + b &lt limit',style))
      File
    "L:\Python24\lib\site-packages\reportlab\platypus\paragraph.py",
    line 445, in __init__
        self._setup(text, style, bulletText, frags, cleanBlockQuotedText)
      File
    "L:\Python24\lib\site-packages\reportlab\platypus\paragraph.py",
    line 469, in _setup
        raise "xml parser error (%s) in paragraph beginning\n'%s'"\
    xml parser error (; missing in entityref) in paragraph beginning
    'm*x + b &lt limit'
     >>>


I'm using reportlab_2_0 under python24.

Thanks for prompt response.
george


Robin Becker wrote:

> george wrote:
>
>> Im documenting some text which includes the following m*x + b < 
>> limit.  When try to insert this into a Paragraph, I get an error 
>> message ending
>>
>>     raise "xml parser error (%s) in paragraph beginning\n'%s'"\
>>    xml parser error (bogus < or &) in paragraph beginning
>>    'm*x + b < limit'
>>     >>>
>>
>> I haven't been able to find out how to escape 'reserved' characters 
>> such as '<' and '>'.
>>
>> thanks
>> george
>>
>
> use &lt; &amp; &gt; for < & > which are the standard xml entities.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://two.pairlist.net/pipermail/reportlab-users/attachments/20061029/d0af85aa/attachment.htm


More information about the reportlab-users mailing list