From tsmets at gmail.com Tue Dec 1 11:03:25 2009 From: tsmets at gmail.com (Thomas Lionel Smets) Date: Tue, 1 Dec 2009 11:03:25 +0100 Subject: [XML-SIG] Python XML Message-ID: Dear, To process XML from Python ... What is the best library ? http://pyxml.sourceforge.net/topics/books.html is officially not supported / maintained anymore There is the libxml2 but there are not much response on google (at first sight). Any relevant pointers would be appreciated :) Tx, \T, -- Thomas SMETS rue J. Wytsmanstraat 62 1050 Brussels m. : +32 497 44 68 12 From cfbearden at gmail.com Tue Dec 1 15:57:14 2009 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue, 1 Dec 2009 08:57:14 -0600 Subject: [XML-SIG] Python XML In-Reply-To: References: Message-ID: <433ebc870912010657j796254b0y9ff81f6417d896e4@mail.gmail.com> On Tue, Dec 1, 2009 at 4:03 AM, Thomas Lionel Smets wrote: > Dear, > > To process XML from Python ... > What is the best library ?? > http://pyxml.sourceforge.net/topics/books.html is officially not > supported / maintained anymore > There is the libxml2 but there are not much response on google (at first sight). > > Any relevant pointers would be appreciated :) Much depends on how you want to process the XML. If you want a Pythonic API that treats an XML instance like a tree, then use ElementTree, which is available in the standard library but is also implemented in the lxml package [1]. The standard library also includes serviceable SAX and DOM implementations. If you want simple, fast, event-driven parsing, try the expat module in the standard library. If you want to use XPath and XSLT 1.0, or if you want to validate against DTDs or RNG schemata, install the excellent lxml package, which uses libxml2 and libxslt under the hood for much of what it does. It also has good tools for working with HTML. lxml has become my own toolset of choice for working with XML in Python, partly because I love XSLT. There are other tools that I haven't gotten around to trying yet, such as 4Suite [2] and Amara [3]. Perhaps others can say something about them, but you should also search the archives of this list to learn more about them on your own. [1] [2] [3] Chuck > > Tx, > > \T, > > -- > Thomas SMETS > rue J. Wytsmanstraat 62 > 1050 Brussels > m. : +32 497 44 68 12 > _______________________________________________ > XML-SIG maillist ?- ?XML-SIG at python.org > http://mail.python.org/mailman/listinfo/xml-sig > From john at nmt.edu Tue Dec 1 23:05:49 2009 From: john at nmt.edu (John W. Shipman) Date: Tue, 1 Dec 2009 15:05:49 -0700 (MST) Subject: [XML-SIG] Python XML In-Reply-To: References: Message-ID: +-- | To process XML from Python ... | What is the best library ? | http://pyxml.sourceforge.net/topics/books.html is officially not | supported / maintained anymore | There is the libxml2 but there are not much response on google (at first sight). | | Any relevant pointers would be appreciated :) +-- We have an official publication, freely available as a Web page or PDF, on my favorite package, lxml: http://www.nmt.edu/tcc/help/pubs/pylxml/ It's fast, easy to use, and suitable for reading, writing or updating XML content. It does not address installation; it is a user-level publication. Best regards, John Shipman (john at nmt.edu), Applications Specialist, NM Tech Computer Center, Speare 119, Socorro, NM 87801, (505) 835-5950, http://www.nmt.edu/~john ``Let's go outside and commiserate with nature.'' --Dave Farber