python from Java

Ajay abra9823 at mail.usyd.edu.au
Tue Sep 7 08:36:30 EDT 2004


hi!

i have xmlproc working and i can build a minidom pretty quickly using it,
which means i can port my exisiting DOM code to the PDA.
but i am going to use SAX and build the object model you mentioned and use
that.
just a question, how hard would it be to actually perform the comparison
using C. ie, pass the dom/object model to a C module and have it do the
comparison. it should considerably speed up things and maybe the best time
to try my knowledge of C. the part i am worried about with using C is
converting the datatypes, ie the object model/minidom to something else in
C.

anyways thanks for your help and suggestions....why didn't i try xmlproc
earlier and a dom with xmlproc is quite fast....well atleast compared to
pxdom.

thanks

cheers


Quoting Alan Kennedy <alanmk at hotmail.com>:

> [Alan Kennedy]
> >>I think the best solution for you is to use and event-based python
> >>parser to parse your XML.
>
> and
>
> >>What you should consider is building your own object model, based on
> the
> >>events generated by your SAX parser. Although this sounds hard, it is
> >>actually extremely easy, as this ActiveState cookbook entry shows.
> >>
> >>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/149368
> >>
> >>There are also multiple cpython products which will build a python
> >>object model from XML events: all of these should be comparatively cpu
> >>and memory efficient.
> >>
> >>Objectify
> >>http://gnosis.cx/download/gnosis/xml/objectify
> >>
> >>Anobind
> >>http://uche.ogbuji.net/tech/4Suite/anobind/
> >>
> >>ElementTree
> >>http://effbot.org/downloads/#elementtree
>
> [Ajay]
> > okay i tried the above approaches but no luck. See the problem is an
> XML
> > parser which works on a PDA - pythonce. Now elementtree uses pyexpat
> > (which  pythonce doesn't have), objectify just needs expat which i
> dont
> > have either and anobind needs 4Suite - there is no port for it to a
> PDA.
> > so i am back to where i was earlier.
> > looking for a reasonably fast and efficient xml parser that works on a
> PDA
> > (DOM or SAX, i dont care)
>
> I see.
>
> OK, rather than us trying to suggest multiple possible solutions, only
> to find out that they are not supported on python-ce, because of lack of
> expat, etc, please can you list for us the xml parsers that *do* work on
> python-ce.
>
> Particularly, I'm interested in whether the xml.sax modules work. Also,
> check to see if sgmllib works, since that can also be used as an
> efficient XML parser. There's got to be *some* event-based XML parser on
> python-ce, even if it is pure-python.
>
> Start by looking at this HOWTO, and see if you can get any of the
> examples running.
>
> http://pyxml.sourceforge.net/topics/howto/section-SAX.html
>
> Once you've got a working event parser, then we'll figure out the best
> way to build a python object model for your xml files.
>
> regards,
>
> --
> alan kennedy
> ------------------------------------------------------
> email alan:              http://xhaus.com/contact/alan
> --
> http://mail.python.org/mailman/listinfo/python-list
>


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the Python-list mailing list