Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5diff
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
erp5diff
Commits
25173463
Commit
25173463
authored
Oct 30, 2009
by
Nicolas Delaby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update test according version 0.6 (add root element in xpath expression)
parent
51c6c3e6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
55 deletions
+72
-55
README
README
+72
-55
No files found.
README
View file @
25173463
...
...
@@ -51,9 +51,9 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/object[@id='313730']/description">description3 çsdf__sdfççç_df___&amp;&amp;é]]]°°°°°°</xupdate:update>
<xupdate:update select="/object[@id='313730']/first_name">Tatuya</xupdate:update>
<xupdate:update select="/object[@id='313730']/workflow_action[@id='edit_workflow']/time">2009/08/28 19:12:24.703 GMT+9</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/description">description3 çsdf__sdfççç_df___&amp;&amp;é]]]°°°°°°</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/first_name">Tatuya</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/workflow_action[@id='edit_workflow']/time">2009/08/28 19:12:24.703 GMT+9</xupdate:update>
</xupdate:modifications>
2. update one element
...
...
@@ -75,7 +75,7 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/object[@id='313730']/description">description3éà@ $*&lt; &lt; -----</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/description">description3éà@ $*&lt; &lt; -----</xupdate:update>
</xupdate:modifications>
3. same
...
...
@@ -142,10 +142,10 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/object[@id='313730']/description">description1 --- $sdfrç_sdfsçdf_oisfsopf</xupdate:update>
<xupdate:update select="/object[@id='313730']/language/attribute::type">None</xupdate:update>
<xupdate:update select="/object[@id='313730']/language"/>
<xupdate:remove select="/object[@id='313730']/workflow_action[@id='edit_workflow'][2]"/>
<xupdate:update select="/
erp5/
object[@id='313730']/description">description1 --- $sdfrç_sdfsçdf_oisfsopf</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/language/attribute::type">None</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/language"/>
<xupdate:remove select="/
erp5/
object[@id='313730']/workflow_action[@id='edit_workflow'][2]"/>
</xupdate:modifications>
5. update two elements includes some symbols
...
...
@@ -169,8 +169,8 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/object[@id='313730']/description">description4 sdflkmooo^^^^]]]]]{{{{{{{</xupdate:update>
<xupdate:update select="/object[@id='313730']/language">ca</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/description">description4 sdflkmooo^^^^]]]]]{{{{{{{</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/language">ca</xupdate:update>
</xupdate:modifications>
6. update two date element which have same id
...
...
@@ -208,8 +208,8 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/object[@id='313730']/workflow_action[@id='edit_workflow'][2]/time">2009/08/28 19:12:40.905 GMT+9</xupdate:update>
<xupdate:update select="/object[@id='313730']/workflow_action[@id='edit_workflow'][3]/time">2009/08/28 19:12:40.910 GMT+9</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/workflow_action[@id='edit_workflow'][2]/time">2009/08/28 19:12:40.905 GMT+9</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/workflow_action[@id='edit_workflow'][3]/time">2009/08/28 19:12:40.910 GMT+9</xupdate:update>
</xupdate:modifications>
7. insert and remove elements
...
...
@@ -239,12 +239,12 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:remove select="/object[@id='313731']/local_role[@id='tk']"/>
<xupdate:append select="/object[@id='313731']" child="first()">
<xupdate:remove select="/
erp5/
object[@id='313731']/local_role[@id='tk']"/>
<xupdate:append select="/
erp5/
object[@id='313731']" child="first()">
<xupdate:element name="local_role"><xupdate:attribute name="type">tokens</xupdate:attribute><xupdate:attribute name="id">tatuya</xupdate:attribute><?xml version="1.0"?><marshal><tuple><string>Owner</string></tuple></marshal></xupdate:element>
<xupdate:element name="JohnDoe">Go to the beach</xupdate:element>
</xupdate:append>
<xupdate:insert-before select="/object[@id='313731']/local_permission[@id='View']">
<xupdate:insert-before select="/
erp5/
object[@id='313731']/local_permission[@id='View']">
<xupdate:element name="local_permission"><xupdate:attribute name="type">tokens</xupdate:attribute><xupdate:attribute name="id">Manage portal content</xupdate:attribute><?xml version="1.0"?></xupdate:element>
</xupdate:insert-before>
</xupdate:modifications>
...
...
@@ -268,7 +268,7 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/object[@id='313731']/local_permission[@id='View']"><?xml version="1.0"?><marshal><tuple><string>Assignee</string><string>Assignor</string><string>Associate</string><string>Auditor</string><string>Author</string><string>Manager</string><string>Owner</string></tuple></marshal></xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313731']/local_permission[@id='View']"><?xml version="1.0"?><marshal><tuple><string>Assignee</string><string>Assignor</string><string>Associate</string><string>Auditor</string><string>Author</string><string>Manager</string><string>Owner</string></tuple></marshal></xupdate:update>
</xupdate:modifications>
9. rename element
...
...
@@ -292,9 +292,9 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:remove select="/object[@id='313730']/first_name"/>
<xupdate:remove select="/object[@id='313730']/last_name"/>
<xupdate:append select="/object[@id='313730']" child="first()">
<xupdate:remove select="/
erp5/
object[@id='313730']/first_name"/>
<xupdate:remove select="/
erp5/
object[@id='313730']/last_name"/>
<xupdate:append select="/
erp5/
object[@id='313730']" child="first()">
<xupdate:element name="given_name"><xupdate:attribute name="type">string</xupdate:attribute>Tatuya</xupdate:element>
<xupdate:element name="family_name"><xupdate:attribute name="type">string</xupdate:attribute>Kamada</xupdate:element>
</xupdate:append>
...
...
@@ -321,13 +321,7 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:rename select="/">erp6</xupdate:rename>
<xupdate:update select="/">
<object portal_type="Person" id="313730">
<id type="string">313730</id>
<title type="string">Tatuya Kamada</title>
</object>
</xupdate:update>
<xupdate:rename select="/erp5">erp6</xupdate:rename>
</xupdate:modifications>
...
...
@@ -350,7 +344,7 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/object[@id='313730']/local_role[@id='fab']/attribute::type">ccc</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/local_role[@id='fab']/attribute::type">ccc</xupdate:update>
</xupdate:modifications>
12. Update two attribute
...
...
@@ -372,8 +366,8 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/object[@id='313730']/local_permission[@id='View']/attribute::attr_a">ccc</xupdate:update>
<xupdate:update select="/object[@id='313730']/local_permission[@id='View']/attribute::type">ccc</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/local_permission[@id='View']/attribute::attr_a">ccc</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/local_permission[@id='View']/attribute::type">ccc</xupdate:update>
</xupdate:modifications>
13. Update three attribute
...
...
@@ -395,9 +389,9 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/object[@id='313730']/title/attribute::attribute_a">nnn</xupdate:update>
<xupdate:update select="/object[@id='313730']/title/attribute::attribute_b">nnn</xupdate:update>
<xupdate:update select="/object[@id='313730']/title/attribute::attribute_c">nnn</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/title/attribute::attribute_a">nnn</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/title/attribute::attribute_b">nnn</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/title/attribute::attribute_c">nnn</xupdate:update>
</xupdate:modifications>
14. Remove one attribute
...
...
@@ -419,7 +413,7 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:remove select="/object[@id='313730']/first_name/attribute::attribute_c"/>
<xupdate:remove select="/
erp5/
object[@id='313730']/first_name/attribute::attribute_c"/>
</xupdate:modifications>
15. Remove two attribute
...
...
@@ -441,8 +435,8 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:remove select="/object[@id='313730']/first_name/attribute::attribute_b"/>
<xupdate:remove select="/object[@id='313730']/first_name/attribute::attribute_c"/>
<xupdate:remove select="/
erp5/
object[@id='313730']/first_name/attribute::attribute_b"/>
<xupdate:remove select="/
erp5/
object[@id='313730']/first_name/attribute::attribute_c"/>
</xupdate:modifications>
...
...
@@ -465,9 +459,9 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:remove select="/object[@id='313730']/first_name/attribute::attribute_a"/>
<xupdate:remove select="/object[@id='313730']/first_name/attribute::attribute_b"/>
<xupdate:remove select="/object[@id='313730']/first_name/attribute::attribute_c"/>
<xupdate:remove select="/
erp5/
object[@id='313730']/first_name/attribute::attribute_a"/>
<xupdate:remove select="/
erp5/
object[@id='313730']/first_name/attribute::attribute_b"/>
<xupdate:remove select="/
erp5/
object[@id='313730']/first_name/attribute::attribute_c"/>
</xupdate:modifications>
17. Append one attribute
...
...
@@ -489,7 +483,7 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:append select="/object[@id='313730']/last_name">
<xupdate:append select="/
erp5/
object[@id='313730']/last_name">
<xupdate:attribute name="attribute_a">aaa</xupdate:attribute>
</xupdate:append>
</xupdate:modifications>
...
...
@@ -514,7 +508,7 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:append select="/object[@id='313730']/last_name">
<xupdate:append select="/
erp5/
object[@id='313730']/last_name">
<xupdate:attribute name="attribute_a">aaa</xupdate:attribute>
<xupdate:attribute name="attribute_b">bbb</xupdate:attribute>
</xupdate:append>
...
...
@@ -539,7 +533,7 @@ ERP5Diff Usage and its output example
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:append select="/object[@id='313730']/last_name">
<xupdate:append select="/
erp5/
object[@id='313730']/last_name">
<xupdate:attribute name="attribute_a">aaa</xupdate:attribute>
<xupdate:attribute name="attribute_b">bbb</xupdate:attribute>
<xupdate:attribute name="attribute_c">ccc</xupdate:attribute>
...
...
@@ -600,9 +594,9 @@ does not work as bellow example. This is a known bug.
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:remove select="/object[@id='313730']/workflow_action[@id='edit_workflow'][2]"/>
<xupdate:remove select="/object[@id='313730']/workflow_action[@id='edit_workflow'][3]"/>
<xupdate:remove select="/object[@id='313730']/workflow_action[@id='edit_workflow'][4]"/>
<xupdate:remove select="/
erp5/
object[@id='313730']/workflow_action[@id='edit_workflow'][2]"/>
<xupdate:remove select="/
erp5/
object[@id='313730']/workflow_action[@id='edit_workflow'][3]"/>
<xupdate:remove select="/
erp5/
object[@id='313730']/workflow_action[@id='edit_workflow'][4]"/>
</xupdate:modifications>
21. Modify two elements that have same id
...
...
@@ -648,9 +642,9 @@ does not work as bellow example. This is a known bug.
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/object[@id='313730']/workflow_action[@id='edit_workflow'][2]/time">2009/08/29 19:12:34.432 GMT+9</xupdate:update>
<xupdate:update select="/object[@id='313730']/workflow_action[@id='edit_workflow'][3]/time">2009/08/30 19:12:34.434 GMT+9</xupdate:update>
<xupdate:update select="/object[@id='313730']/workflow_action[@id='edit_workflow'][4]/time">2009/08/31 19:12:34.436 GMT+9</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/workflow_action[@id='edit_workflow'][2]/time">2009/08/29 19:12:34.432 GMT+9</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/workflow_action[@id='edit_workflow'][3]/time">2009/08/30 19:12:34.434 GMT+9</xupdate:update>
<xupdate:update select="/
erp5/
object[@id='313730']/workflow_action[@id='edit_workflow'][4]/time">2009/08/31 19:12:34.436 GMT+9</xupdate:update>
</xupdate:modifications>
22. Modify attributes of sequencial objects
...
...
@@ -688,8 +682,8 @@ does not work as bellow example. This is a known bug.
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/object[2]/title">B</xupdate:update>
<xupdate:update select="/object[3]/title">C</xupdate:update>
<xupdate:update select="/
erp5/
object[2]/title">B</xupdate:update>
<xupdate:update select="/
erp5/
object[3]/title">C</xupdate:update>
</xupdate:modifications>
23. Modify nodes with Qualified Names
...
...
@@ -729,15 +723,15 @@ does not work as bellow example. This is a known bug.
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:remove select="/object[2]/prefixbis:title"/>
<xupdate:append select="/object[2]" child="first()">
<xupdate:remove select="/
erp5/
object[2]/prefixbis:title"/>
<xupdate:append select="/
erp5/
object[2]" child="first()">
<xupdate:element name="prefix:title" namespace="http://any_uri"><xupdate:attribute name="prefix:myattr" namespace="http://any_uri">anyvalue</xupdate:attribute>B</xupdate:element>
</xupdate:append>
<xupdate:remove select="/object[3]/againanotherprefix:title"/>
<xupdate:append select="/object[3]" child="first()">
<xupdate:remove select="/
erp5/
object[3]/againanotherprefix:title"/>
<xupdate:append select="/
erp5/
object[3]" child="first()">
<xupdate:element name="title">A</xupdate:element>
</xupdate:append>
<xupdate:insert-after select="/object[3]">
<xupdate:insert-after select="/
erp5/
object[3]">
<xupdate:element name="erp5:object" namespace="http://www.erp5.org/namespaces/erp5_object">
<xupdate:attribute name="portal_type">Test</xupdate:attribute>
<title>B</title>
...
...
@@ -768,9 +762,32 @@ does not work as bellow example. This is a known bug.
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/object/title/attribute::prefix:attr">B</xupdate:update>
<xupdate:update select="/
erp5/
object/title/attribute::prefix:attr">B</xupdate:update>
</xupdate:modifications>
25. Modify nodes with Qualified Names at root level
Work on Attributes specially
>>> old_xml = """
... <erp5:erp5 xmlns:erp5="http://www.erp5.org/namspaces/erp5_object" a="aaa" b="bbb">
... <object portal_type="Test">
... <title xmlns:prefix="http://any_uri" prefix:attr="A">A</title>
... </object>
... </erp5:erp5>
... """
>>> new_xml = """
... <aaa:erp5 xmlns:aaa="http://www.erp5.org/namspaces/aaa" b="bbb" >
... <object portal_type="Test">
... <title xmlns:prefix="http://any_uri" prefix:attr="B">A</title>
... </object>
... </aaa:erp5>
... """
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:rename select="/erp5:erp5">aaa:erp5</xupdate:rename>
<xupdate:remove select="/aaa:erp5/attribute::a"/>
<xupdate:update select="/aaa:erp5/object/title/attribute::prefix:attr">B</xupdate:update>
</xupdate:modifications>
- 2003-12-04, Yoshinori OKUJI <yo@nexedi.com>
- 2009-09-15, Tatuya Kamada <tatuya@nexedi.com>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment