[reportlab-users] Using XML entities in PythonPoint?

Dinu Gherman reportlab-users@reportlab.com
Tue, 11 Feb 2003 10:12:12 +0100


[Sorry if you're receiving this twice.]

Hi,

I can't remember if this was a general PP problem or if there was
some workaround for it. I find that it's hard to add XML entities
like > to PP text as is showcased in the following sample
snippet below. PP gives me an error in paragraph.py complaining
about the entity which it sees as a literal '<':

   ...
   File 
"/usr/lib/python2.2/site-packages/reportlab/platypus/paragraph.py", 
line 341, in __init__
     self._setup(text, style, bulletText, frags, cleanBlockQuotedText)
   File 
"/usr/lib/python2.2/site-packages/reportlab/platypus/paragraph.py", 
line 365, in _setup
     raise "xml parser error (%s) in paragraph beginning\n'%s'"\
xml parser error (garbage in start tag) in paragraph beginning
'<More Trees, less Bushes!>'

So, here's my PP snippet:

<presentation filename="sample2.pdf">
     <stylesheet module="standard" function="getParagraphStyles"/>
     <section>
         <slide>
             <frame width="840" y="0" x="0" height="400">
                 <para style="Title">
                     &lt;More Trees, less Bushes!&gt;
                 </para>
             </frame>
         </slide>
     </section>
</presentation>

Dinu

--
Dinu C. Gherman
......................................................................
"Ansar al Islam, the militant group that supposedly has links both
to Saddam Hussein and to Al Qaeda, gave reporters a tour of the camp
that Colin Powell identified as a poison factory. They found a primi-
tive collection of buildings powered only by a small generator. The
buildings had no plumbing. A State Department functionary insisted,
however, that Powell's description of the camp was accurate: "A poi-
son factory," he said, 'is a term of art.'"
(Roger D. Hodge, Harper's Magazine, Weekly Review of 11 Feb. 2003,
http://www.harpers.org/weekly-review)