Skip to content

Commit

Permalink
[svn r2484] intro cleanup
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
scoder committed Jun 19, 2007
1 parent 0389efd commit 5a4f99c
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions doc/intro.txt
Expand Up @@ -14,28 +14,29 @@ Motto


To explain the motto: To explain the motto:


"Programming with libxml2 is like the thrilling embrace of an exotic "Programming with libxml2 is like the thrilling embrace of an exotic stranger.
stranger. It seems to have the potential to fulfill your wildest It seems to have the potential to fulfill your wildest dreams, but there's a
dreams, but there's a nagging voice somewhere in your head warning you nagging voice somewhere in your head warning you that you're about to get
that you're about to get screwed in the worst way." (`a quote by Mark screwed in the worst way." (`a quote by Mark Pilgrim`_)
Pilgrim`_)

Mark Pilgrim was describing in particular the experience a Python programmer
Mark Pilgrim was describing in particular the experience a Python has when dealing with libxml2. The default Python bindings of libxml2 are
programmer has when dealing with libxml2. libxml2's default Python fast, thrilling, powerful, and your code might fail in some horrible way that
bindings are fast, thrilling, powerful, and your code might fail in you really shouldn't have to worry about when writing Python code. lxml
some horrible way that you really shouldn't have to worry about when combines the power of libxml2 with the ease of use of Python.
writing Python code. lxml tries to combine the power of libxml2 with
the ease of use of Python.


.. _`a quote by Mark Pilgrim`: http://diveintomark.org/archives/2004/02/18/libxml2 .. _`a quote by Mark Pilgrim`: http://diveintomark.org/archives/2004/02/18/libxml2



Aims Aims
---- ----


The C libraries libxml2_ and libxslt_ have huge benefits: The C libraries libxml2_ and libxslt_ have huge benefits:


* Standards-compliant XML support. * Standards-compliant XML support.


* Support for (broken) HTML.

* Full-featured. * Full-featured.


* Actively maintained by XML experts. * Actively maintained by XML experts.
Expand All @@ -46,21 +47,23 @@ The C libraries libxml2_ and libxslt_ have huge benefits:


.. _libxslt: http://xmlsoft.org/XSLT .. _libxslt: http://xmlsoft.org/XSLT


These libraries already ship with Python bindings, but these Python
bindings have problems. In particular: These libraries already ship with Python bindings, but these Python bindings
mimic the C-level interface. This yields a number of problems:


* very low level and C-ish (not Pythonic). * very low level and C-ish (not Pythonic).


* underdocumented and huge, you get lost in them. * underdocumented and huge, you get lost in them.


* UTF-8 in API, instead of Python unicode strings. * UTF-8 in API, instead of Python unicode strings.


* can cause segfaults from Python. * Can easily cause segfaults from Python.

* Require manual memory management!


* have to do manual memory management!


lxml is a new Python binding for libxml2 and libxslt, completely lxml is a new Python binding for libxml2 and libxslt, completely independent
independent from these existing Python bindings. Its aim: from these existing Python bindings. Its aims:


* Pythonic API. * Pythonic API.


Expand All @@ -72,9 +75,8 @@ independent from these existing Python bindings. Its aim:


* No manual memory management! * No manual memory management!


lxml aims to provide a Pythonic API by following as much as possible lxml aims to provide a Pythonic API by following as much as possible the
the `ElementTree API`_. We're trying to avoid having to invent too `ElementTree API`_. We're trying to avoid inventing too many new APIs, or you
many new APIs, or you having to learn new things -- XML is complicated having to learn new things -- XML is complicated enough.
enough.


.. _`ElementTree API`: http://effbot.org/zone/element-index.htm .. _`ElementTree API`: http://effbot.org/zone/element-index.htm

0 comments on commit 5a4f99c

Please sign in to comment.