[reportlab-users] pyRXP -> XML
Andy Robinson
reportlab-users@reportlab.com
Wed, 4 Dec 2002 12:23:55 -0000
Eric, I just unblocked your attachment from our mailing list
(it got spam filtered due to size).
If anyone else wants to send files over 40k, the best procedure is:
1. anonymous ftp to ftp.reportlab.com/incoming/
2. email the liist to tell us about it
Did you know we have a module pyRXP/examples/xmlutils.py in
the CVS tree and distro? I think that's the home for this
function and will try to add it there at the weekend. Since
pyRXP is a tool for speed freaks, I will suggest a couple of
changes:
1. it could probably go faster by building a list of strings
which is passed around, then doing 'join'.
2. we need to be careful with quoting as stuff might already
be quoted, depending on your parser options. I have a regex
somewhere to find '&' which is not followed b 'amp;' and so
on. I can see 3 options: (a) quote stuff (fast), (b)
never quote (fastest), (c) quote stuff that needs quoting
(a tad slower but safest).
Also, the object tree you want is already there in our TagWrapper
class. We use it every day and the syntax is very pleasant.
The idea is that it only converts nodes to objects when you
access them. It could certainly have more features and I'd welcome
testing or additions.
Alex Martelli also gave me many nice ideas on iterators and there
are some thoughts on useful utilities in the back of the pyRXP
manual.
I just realised the manual is included in the snapshot on our download
page, but in Report Markup Language which is commercial. Users
can built this with a nag line on each page, but there's a
finished copy here:
http://www.reportlab.com/docs/pyRXP_Documentation.pdf
Thanks,
Andy
-----Original Message-----
From: reportlab-users-admin@reportlab.com
[mailto:reportlab-users-admin@reportlab.com]On Behalf Of Eric van Riet
Paap
Sent: 02 December 2002 17:02
To: reportlab-users@reportlab.com
Subject: [reportlab-users] pyRXP -> XML
Hi,
I'm working on some small additions to your pyRXP package. So far I
only have one useful function. Perhaps you can put in the next version
of pyRXP if you find is worthwhile! The one function I have currently
convert a pyRXP tuple back to XML (for saving xml), this is very handy
when you modify the tuple after parsing it with pyRXP) . The source it
very small, the zip file somewhat large (for what it does) because
some large xml files are embedded for unittesting. Another thing I
plan add is a convertor for pyRXP tuples to an object-tree where the
goal is to accessing the data is as straigtforward as possible. pyRXP
tuples are very clean,small,etc. but accessing them is not really
clean looking.
All comments are welcome!
kind regards,
Eric van Riet paap
Utrecht, The Netherlands