473,805 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

4xupdate trouble

Hi,

I'm trying to write a script that uses diffxml along with 4xupdate
to merge XML files. So far, I'm having trouble with even the most
basic files. I have tried different versions of the components, to no
avail. Are there any alternatives? I've put sample files below.

Thanks,
Eyal.

=============== =============== ======

I want to merge this:

<?xml version="1.0"?>
<root>
<codecs a="10" b="20" />
<timeouts c="10" d="20" e="30" />
<reporting f="10" g="20" />
<lims h="10" />
</root>

with this (note the difference in the reporting node. If the reporting
node does not change, or attributes are added, but none are removed,
4xupdate works):

<?xml version="1.0"?>
<root>
<codecs a="1" b="2" />
<timeouts c="1" d="2" e="3" />
<reporting f="1" z="3" />
<lims h="1">
<lim0 i="1" />
<lim1 i="2" />
<lim2 i="3" />
<lim3 i="4" />
</lims>
<HW j="1" />
</root>

and I get a bunch of errors:
Traceback (most recent call last):
File "/usr/bin/xmldiff", line 5, in ?
xmldiff.run(*sy s.argv)
File "/usr/lib/python2.3/site-packages/logilab/xmldiff/xmldiff.py",
line 218, in run
encoding, html)
File "/usr/lib/python2.3/site-packages/logilab/xmldiff/xmldiff.py",
line 114, in process_files
strategy.proces s_trees(tree1, tree2)
File "/usr/lib/python2.3/site-packages/logilab/xmldiff/fmes.py", line
104, in process_trees
self._formatter .end()
File "/usr/lib/python2.3/site-packages/logilab/xmldiff/format.py",
line 212, in end
AbstractFormatt er.end(self)
File "/usr/lib/python2.3/site-packages/logilab/xmldiff/format.py",
line 80, in end
self.format_act ion(action)
File "/usr/lib/python2.3/site-packages/logilab/xmldiff/format.py",
line 203, in format_action
self._stream.wr ite(action[A_N2])
TypeError: argument 1 must be string or read-only character buffer, not
list

and a diff file looking like this:

<?xml version="1.0"?>
<xupdate:modifi cations version="1.0"
xmlns:xupdate=" http://www.xmldb.org/xupdate">
<xupdate:inse rt-after select="/root[1]/reporting[1]" >
<xupdate:elemen t name="lims"> <xupdate:attrib ute
name="h">1</xupdate:attribu te>
<lim0 i="1"/>
<lim1/>
<lim2 i="3"/>
<lim3 i="4"/>
</xupdate:element >
</xupdate:insert-after>

<xupdate:rena me select="/root[1]/lims[2]" >HW</xupdate:rename>

<xupdate:appe nd select="/root[1]/reporting[1]" > <xupdate:attrib ute
name="z">3</xupdate:attribu te>
</xupdate:append>

<xupdate:rena me select="/root[1]/HW[1]/@h" >j</xupdate:rename>

<xupdate:upda te select="/root[1]/codecs[1]/@a" >1</xupdate:update>

<xupdate:upda te select="/root[1]/codecs[1]/@b" >2</xupdate:update>

<xupdate:upda te select="/root[1]/timeouts[1]/@c" >1</xupdate:update>

<xupdate:upda te select="/root[1]/timeouts[1]/@d" >2</xupdate:update>

<xupdate:upda te select="/root[1]/timeouts[1]/@e" >3</xupdate:update>

<xupdate:upda te select="/root[1]/reporting[1]/@f" >1</xupdate:update>

<xupdate:rena me select="/root[1]/reporting[1]/@g" >i</xupdate:rename>

<xupdate:move select="[2, '@iName', 'i', [[3, '@i', '2', [], [...], 0,
1, 1, 1]], [1, 'lim1', 'lim1', [[...]], [1, 'lims', 'lims', [[2,
'@hName', 'h', [[3, '@h', '1', [], [...], 0, 1, 1, 1]], [...], 1, 1, 1,
1], [1, 'lim0', 'lim0', [[2, '@iName', 'i', [[3, '@i', '1', [], [...],
0, 1, 1, 1]], [...], 1, 1, 1, 1]], [...], 2, 1, 1, 1], [...], [1,
'lim2', 'lim2', [[2, '@iName', 'i', [[3, '@i', '3', [], [...], 0, 1, 1,
1]], [...], 1, 1, 1, 1]], [...], 2, 1, 1, 1], [1, 'lim3', 'lim3', [[2,
'@iName', 'i', [[3, '@i', '4', [], [...], 0, 1, 1, 1]], [...], 1, 1, 1,
1]], [...], 2, 1, 1, 1]], [1, 'root', 'root', [[1, 'codecs', 'codecs',
[[2, '@aName', 'a', [[3, '@a', '1', [], [...], 0, 1, 1, 1]], [...], 1,
0, 1, 1], [2, '@bName', 'b', [[3, '@b', '2', [], [...], 0, 1, 1, 1]],
[...], 1, 0, 1, 1]], [...], 4, 1, 1, 1], [1, 'timeouts', 'timeouts',
[[2, '@cName', 'c', [[3, '@c', '1', [], [...], 0, 1, 1, 1]], [...], 1,
0, 1, 1], [2, '@dName', 'd', [[3, '@d', '2', [], [...], 0, 1, 1, 1]],
[...], 1, 0, 1, 1], [2, '@eName', 'e', [[3, '@e', '3', [], [...], 0, 1,
1, 1]], [...], 1, 0, 1, 1]], [...], 6, 1, 1, 1], [1, 'reporting',
'reporting', [[2, '@fName', 'f', [[3, '@f', '1', [], [...], 0, 1, 1,
1]], [...], 1, 0, 1, 1], [2, '@zName', 'z', [[3, '@z', '3', [], [...],
0, 1, 1, 1]], [...], 1, 1, 1, 1]], [...], 4, 1, 1, 1], [...], [1, 'HW',
'HW', [[2, '@jName', 'j', [[3, '@j', '1', [], [...], 0, 1, 1, 1]],
[...], 1, 1, 1, 1]], [...], 2, 1, 1, 1]], [6, '/', '', [[...]], None,
21, 0, 0, 1], 20, 1, 1, 1], 14, 1, 1, 1], 2, 1, 1, 1], 1, 1, 0, 1]" >

Apr 25 '06 #1
1 1649
The title of this query is misleading - my problem is with the xupdate
file created by xmldiff. I'm using libxml2 2.5.11, since according to
the documentation, this is the newest version that is known to work
with xmldiff.

Thanks.

Apr 25 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1890
by: James | last post by:
Hi I am having some trouble getting a asp page to load. Im a noob to the asp side. I have followed knowledege base Article 301305. I am running 2000 adv, IIS 5.0 I have the following settings to the folder that has the asp. Application settings
4
3850
by: Jacek Dziedzic | last post by:
Hi! First of all, I hope my problem is not too loosely tied to the "standard C++" that is the topic of this group. I have some code that exhibits a strange behaviour: on one computer, where I compile with g++-3.2 it compiles and works fine, on another computer, whether I compile with g++-3.0 or g++-2.95 (unfortunately 3.2 is not available) it crashes with a segmentation violation on runtime.
0
1566
by: Paul C | last post by:
Hello, everybody. I am having trouble running some of the VS.NET samples, specifically the CarSelector web app, which is very simple. The symptom is that the web controls (drop down listboxes and such) do not render correctly. They're almost invisible, and the others don't work at all, but just show their caption text. Not what should happen This strange behavior is happening on my new laptop, which came with XP Home, but I immediately...
0
1510
by: Alexandre Jaquet | last post by:
Hi does anybody know how to solve my trouble, when I try to create a MS Office project I always got trouble. I can't create office project when I try to create one vs.net restart ... :s
1
2007
by: Jim Bancroft | last post by:
Hi everyone, I'm running into a problem with my ASP.Net application. I've just created a new aspx page which uses some new components of mine that inherit from ServicedComponent and are designed to run under COM+. This page works fine, unless I get fancy and hit my browser's refresh button quickly, as a test. Then, what I see happen is the transactions pile up and my ASP.Net "current requests" do the same. This happens even with two...
6
3812
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for one day): \\FFDS24\ASP.NET Applications(_LM_W3SVC_1_Root_ATV2004)\Errors During Execution: 7 \\FFDS24\ASP.NET Apps v1.1.4322(_LM_W3SVC_1_Root_ATV2004)\Compilations
3
5007
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
2
1559
by: JLupear | last post by:
I am having trouble with my code again, I had prepared a question and the code to upload, however I am having trouble posting it, are there limits to the amount of lines you can post? I split it into 4 parts and am still having trouble uploading it. What am I doing wrong?
0
1680
by: mrchatgroup | last post by:
news from http://www.mrchat.net/myblog/myblog/small-accidents-mean-big-trouble-for-supercollider.html Small Accidents Mean Big Trouble for Supercollider Image Scientists expect startup glitches in the massive, complex machines they use to smash atoms.
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10607
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10359
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10104
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5541
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.