Skip to main content

Introduction

Apply xupdate diff on XML documents.

Testing

To run tests:

python -m unittest discover src

or, using zc.buildout and zope.testrunner:

buildout
./bin/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.5 (2022-09-14)

  • Support python3 and python2.7 by dropping dependency on PyXML

0.4 (2010-01-21)

  • [Fix] sub element might have been append in wrong order

    [nicolas Delaby]

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]

Metadata

Release files for xupdate-processor 0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xupdate-processor 0.5
File Size Uploaded
xupdate-processor-0.5.tar.gz 10.8 kB Details

Release files / xupdate-processor-0.5.tar.gz

Download URL xupdate-processor-0.5.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fd69730a1e91ba904c6359ffd50245ccb966aefe65f351cab8da4de132d08293
BLAKE2b-256 checksum
How to use checksums
b3022bfaed5ec16016d91ff368265f737b7547dbcdbbc1b5bca5b8afeb77bcd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.2

Release history Release notifications | RSS feed

This release

0.5 This release

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page