XUpdate Processor
Project description
Introduction
============
Apply xupdate diff on XML documents.
Installation
============
python setup.py install
Testing
=======
python setup.py test
Usage
=====
just like this::
>>> from xupdate_processor import applyXUpdate
>>> from lxml import etree
>>> xml_doc_string = """<?xml version="1.0"?>
<erp5>
<object portal_type="Test">
<title>A</title>
</object>
<object portal_type="Test">
<title>A</title>
</object>
<object portal_type="Test">
<title>A</title>
</object>
</erp5>
"""
>>> xml_xu_string = """<?xml version="1.0"?>
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/erp5/object[2]/title">B</xupdate:update>
<xupdate:update select="/erp5/object[3]/title">C</xupdate:update>
</xupdate:modifications>
"""
>>> result_tree = applyXUpdate(xml_xu_string=xml_xu_string, xml_doc_string=xml_doc_string)
>>> print etree.tostring(result_tree, pretty_print=True)
<erp5>
<object portal_type="Test">
<title>A</title>
</object>
<object portal_type="Test">
<title>B</title>
</object>
<object portal_type="Test">
<title>C</title>
</object>
</erp5>
History
=======
0.4 (unreleased)
----------------
0.3 2010-01-19
--------------
- Update setup.py
0.2 (2010-01-19)
----------------
- refactor egg structure directory
[nicolas Delaby]
- Use unittest module instead of DOCTEST
[nicolas Delaby]
- add PyXML dependency to support sax parser with
xml.sax.handler.feature_namespace_prefixes feature.
[nicolas Delaby]
- remove zope.interface dependency
- [Fix] sub element might have been append in wrong order
0.1 (2009-12-12)
----------------
- Initial implementation
[nicolas Delaby]
============
Apply xupdate diff on XML documents.
Installation
============
python setup.py install
Testing
=======
python setup.py test
Usage
=====
just like this::
>>> from xupdate_processor import applyXUpdate
>>> from lxml import etree
>>> xml_doc_string = """<?xml version="1.0"?>
<erp5>
<object portal_type="Test">
<title>A</title>
</object>
<object portal_type="Test">
<title>A</title>
</object>
<object portal_type="Test">
<title>A</title>
</object>
</erp5>
"""
>>> xml_xu_string = """<?xml version="1.0"?>
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/erp5/object[2]/title">B</xupdate:update>
<xupdate:update select="/erp5/object[3]/title">C</xupdate:update>
</xupdate:modifications>
"""
>>> result_tree = applyXUpdate(xml_xu_string=xml_xu_string, xml_doc_string=xml_doc_string)
>>> print etree.tostring(result_tree, pretty_print=True)
<erp5>
<object portal_type="Test">
<title>A</title>
</object>
<object portal_type="Test">
<title>B</title>
</object>
<object portal_type="Test">
<title>C</title>
</object>
</erp5>
History
=======
0.4 (unreleased)
----------------
0.3 2010-01-19
--------------
- Update setup.py
0.2 (2010-01-19)
----------------
- refactor egg structure directory
[nicolas Delaby]
- Use unittest module instead of DOCTEST
[nicolas Delaby]
- add PyXML dependency to support sax parser with
xml.sax.handler.feature_namespace_prefixes feature.
[nicolas Delaby]
- remove zope.interface dependency
- [Fix] sub element might have been append in wrong order
0.1 (2009-12-12)
----------------
- Initial implementation
[nicolas Delaby]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xupdate-processor-0.3.tar.gz
(15.5 kB
view details)
File details
Details for the file xupdate-processor-0.3.tar.gz
.
File metadata
- Download URL: xupdate-processor-0.3.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2c6d7454b67a28d7260b1613e931409bae9a39d6379fd35f54cb442446a5924 |
|
MD5 | d64c033f9feb750c0c21eeadecd8ca2d |
|
BLAKE2b-256 | a00dd728e71d1c1a8736dbd65bd85467c0ea701f02acb4731509c09d15e5c83b |