Luke Ross

lxmlmeld

6 releases 19 commits git clone

Meld-like templating using lxml.

ad53da716e8886051497d3e3aca91207d607b326 /

lxmlmeld/
tests/
.gitignore Initial commit 5 Feb 2016
LICENSE Move home page 8 Jun 2018
README.rst setup.py wants RST for readme 17 Mar 2017
setup.py Move home page 8 Jun 2018

README.rst

lxmlmeld
========

A mostly-compatible  implementation of `Meld3
<https://github.com/supervisor/meld3>`_ using `lxml <http://lxml.de/>`_ as the
parsing and serialisation engine.

I previously forked Meld3 and made it use lxml, but the code wasn't elegant
as it didn't use much of lxml's additional features. This version is a
from-the-ground-up rewrite based on the Meld3 documentation and test suite.

Key Differences
---------------

- ``fillmeldhtmlform()`` is not implemented (it's rather too magic)
- ``findwithattrib`` is not implemented (as unclear how it interacts with
  namespaces; use lxml's finders or xpath)
- ``replace()`` follows the meld3 syntax; the lxml call of the same name is
  renamed ``replace_child()``
- The property ``parent`` doesn't exist; use ``getparent()``
- You can pass lxml Elements or lists of Elements to ``replace()``,
  ``content()`` and ``fillmelds()``
- When using ``structure=True`` the content must be broadly parsable as XML
- ``repeat`` inserts adjacent to the original node, not at the end of the
  parent
- doctypes to the ``write_*`` functions can be plain strings