xupdate处理器

xupdate-processor的Python项目详细描述


简介

对XML文档应用xupdate diff。

安装

python setup.py安装

测试

python setup.py测试

用法

就像这样:

>>> 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>

历史记录

0.5(未发布)

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]

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何强制用户在允许访问活动之前处理对话框?我的许可证代码怎么了?   java ArraysList作为JSON   mysql如何在java中创建包含多个可选where子句的搜索语句?   java如何让Apache Camel在“直接”路径的末尾删除文件?   使用socket在两个Androids之间进行java实时数据传输。IO(websocket)和4G   如何在java中实现两个CORBA服务器之间的通信   会话树xml表示为java对象   java Skype4Java编号swtwin323325   java RecyclerView getAdapterPosition()不工作:第一次单击返回正确位置,第二次单击返回1   java在$TOMCAT/conf/context上为JNDI设置资源。xml   java为什么第二个矩形冲突在第一个矩形冲突时不起作用?   JScrollPane上的java JTextArea未出现在JPanel上   java如何将实现的PriorityQueue打印为字符串?   jpa使用Jersey更新用户角色RESTJava(JAXRS)